#include #include ; Create application object and open an example workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Export Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Export cells A1:E10 of the active worksheet as PDF and display the file. ; ***************************************************************************** Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\MaxClimbing_facturatie_tool.xlsx") Local $sResult = _Excel_RangeRead($oWorkbook, "Simple Invoice Dutch", "H6", Default) MsgBox(0,"Factuurnummer", $sResult) Local $sOutput = @DesktopDir & "\" & $sResult & ".pdf" _Excel_Export($oExcel, "B2:H47", $sOutput, Default, Default, Default, Default, Default, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Export Example 1", "Error saving range to '" & $sOutput & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Export Example 1", "Range successfully exported as '" & $sOutput & "'.")