-
Mar 8th, 2018, 01:06 PM
#1
Thread Starter
Addicted Member
Run exporting as windows service
Using windows service to run Console application which will generate Excel and convert it to pdf.
When i run that console application manually it works like a charm but when windows service start it it does pop up error
Not enough storage is available to complete this operation. (Exception from HRESULT: 0x8007000E (E_OUTOFMEMORY))
Windows service to start console app is using code shown bellow
Code:
Private Sub ProcessStart(path As String)
Dim proc As New Process
proc.StartInfo.UseShellExecute = False
proc.StartInfo.CreateNoWindow = True
proc.StartInfo.ErrorDialog = False
proc.StartInfo.RedirectStandardOutput = True
proc.StartInfo.FileName = path
proc.Start()
proc.WaitForExit()
Dim output As String = proc.StandardOutput.ReadToEnd()
End Sub
Console application use code above to generate the pdf file
Code:
workbook.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, myCfg.ExportPath & "\" & fileName & ".pdf", Excel.XlFixedFormatQuality.xlQualityStandard)
And that was the line which throw mentioned error.
What i have tried
Tried to set Interactive user in window compnents on excel
Result : Error
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
-
Mar 8th, 2018, 01:17 PM
#2
Re: Run exporting as windows service
-
Mar 9th, 2018, 10:01 AM
#3
Thread Starter
Addicted Member
Re: Run exporting as windows service
JDC2000 i already tried all of that but nothing.
I dont see a problem with hardware configuration since it works like a charm with manually run.
-
Mar 9th, 2018, 05:32 PM
#4
Thread Starter
Addicted Member
Re: Run exporting as windows service
Ok do we have other free solution for converting file from excel to pdf.
I need the simplest solution to convert file xls from path A to pdf on path B
Was googled for a solution online but most of solutions are paid to use. Possibly the best solution would be to get code snippet
Tried with :
Spire, iText ...
-
Mar 9th, 2018, 07:44 PM
#5
Re: Run exporting as windows service
If it works when run manually, why not just make a batch file and a scheduled item in Task Scheduler to run it?
-
Mar 10th, 2018, 02:56 PM
#6
Thread Starter
Addicted Member
Re: Run exporting as windows service
Since it is not posible to export directly from windkws service i made console app which will do that. So windows service only runs it. Windows service is checking user defined configuration and run the console app depending on that. I only can try to execute batch file which will run console app. Dear god
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|