Referring to the example
www.b4x.com
I can successfully save the excel file but am getting error when exporting the PDF.
You cannot call a method on a null-valued expression.
At line:1 char:58
+ ... application;$workbook = $objExcel.workbooks.open('C:\Users\aeric\Desk ...
[XLUtils] Generate PDF reports
XLUtils v1.13 adds support for converting workbooks to PDF. This is a Windows only feature and it relies on Excel being installed on the computer. Exporting to PDF is a matter of calling: Wait For (xl.PowerShellConvertToPdf(WorkbookFile, OutputPDF, SheetIndex, True)) Complete (Success As...
I can successfully save the excel file but am getting error when exporting the PDF.
You cannot call a method on a null-valued expression.
At line:1 char:58
+ ... application;$workbook = $objExcel.workbooks.open('C:\Users\aeric\Desk ...
B4X:
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
You cannot call a method on a null-valued expression.
At line:1 char:58
+ ... application;$workbook = $objExcel.workbooks.open('C:\Users\aeric\Desk ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Cannot index into a null array.
At line:1 char:150
+ ... t.xlsx', 3);$workbook.Sheets[1].ExportAsFixedFormat($xlFixedFormat::x ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
You cannot call a method on a null-valued expression.
At line:1 char:268
+ ... esktop\Pie\B4J\Objects\test.pdf');$objExcel.Workbooks.close();$objExc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "Quit" with "0" argument(s): "Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'.
This operation failed because the QueryInterface call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception
from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))."
At line:1 char:296
+ ... \B4J\Objects\test.pdf');$objExcel.Workbooks.close();$objExcel.Quit()}
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidCastException