I am trying to produce a pdf file using Erel's examples and I keep getting errors.
It doesn't matter if I am trying with the word example or excel example , the same thing happens. The excel and word files are created just fine, I can open them, but no pdf files. I originally thought it might be because I don't have excel installed (I use open office) but then I read that excel is not required for this process based on this posting.
Not sure where to go from here, I have all the required libraries and they are all up to date.
TIA
Document saved: C:\Users\doc\AppData\Roaming\word example\Report.docx
New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed
due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At line:1 char:17
+ ; & {$objWord = New-Object -ComObject word.application;$document ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
You cannot call a method on a null-valued expression.
At line:1 char:56
+ ... application;$document = $objWord.Documents.open('C:\Users\doc\AppDat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:1 char:152
+ ... rt.docx'); $document.SaveAs([ref] 'C:\Users\doc\AppData\Roaming\word ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:1 char:245
+ ... ing\word example\Report.pdf', [ref] 17); $document.Close();$objWor ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:1 char:263
+ ... example\Report.pdf', [ref] 17); $document.Close();$objWord.Quit()}
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
It doesn't matter if I am trying with the word example or excel example , the same thing happens. The excel and word files are created just fine, I can open them, but no pdf files. I originally thought it might be because I don't have excel installed (I use open office) but then I read that excel is not required for this process based on this posting.
XLUtils / jPOI 5 - Read and write MS Excel workbooks
As written here, I plan to make it easier to read and write Excel workbooks. The solution is based on three components: - Apache POI - https://poi.apache.org/ Large open source project that provides APIs for Microsoft documents. Note that the files are accessed directly, it doesn't depend on the...www.b4x.com
Not sure where to go from here, I have all the required libraries and they are all up to date.
TIA