Search the Community
Showing results for tags 'Excel.Application'.
-
I have a test file that creates an Excel.Application object, and it works OK when I run it with F5, but when I compile it and run the executble, the operation fails. Here is my code: Opt('MustDeclareVars', 1) Global $oMyError, $oExcel _Main() Exit (1) Func _Main() Local $str $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Initialize a COM error handler If IsObj($oMyError) Then $oExcel = ObjCreate("Excel.Application") If IsObj($oExcel) Then $str = "Created the Excel.Application object OK" Else $str = "ObjCreate() FAILED!" EndIf Else $str = "ObjEvent() FAILED!" EndIf MsgBox(0, "results", $str) EndFunc ;==>_Main Func MyErrFunc() Local $str $str = "We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext ClipPut($str) MsgBox(0, "AutoItCOM Test", $str & @CRLF & "(results are in the clipboard)") Exit (1) EndFunc ;==>MyErrFunc Here is the error info: We intercepted a COM Error ! err.description is: err.windescription: Not enough storage is available to complete this operation. err.number is: 8007000E err.lastdllerror is: 0 err.scriptline is: -1 err.source is: err.helpfile is: err.helpcontext is: