
I'm trying to write a script that connects with a VBA/COM API to get the status of a connected phone. helpcontext MsgBox ( 0, "AutoItCOM Test", $str ) EndFunc =>MyErrFunc helpfile & & _ "err.helpcontext is: " & & $oMyError. source & & _ "err.helpfile is: " & & $oMyError.

scriptline & & _ "err.source is: " & & $oMyError. lastdllerror & & _ "err.scriptline is: " & & $oMyError. number, 8 ) & & _ "err.lastdllerror is: " & & $oMyError. windescription & & _ "err.number is: " & & Hex ( $oMyError. description & & _ "err.windescription: " & & $oMyError.

OpenNew ( ) Else msgbox ( 0, "ERROR", "ObjEvent() FAILED!" ) EndIf EndFunc =>_Main Func openExisting ( $fn ) If ( FileExists ( $fn ) ) Then $oExcel = _ExcelBookOpen ( $fn, 0, 1 ) If IsObj ( $oExcel ) Then $str = "_ExcelBookOpen(): OK" _ExcelBookClose ( $oExcel ) Else $str = "_ExcelBookOpen(): FAILED!" EndIf Else $str = "File does not exist:" & & " " & $fn EndIf MsgBox ( 0, "openExisting() results", $str ) EndFunc =>openExisting Func openNew ( ) $oExcel = ObjCreate ( "Excel.Application" ) If IsObj ( $oExcel ) Then $str = "Created the Excel.Application object OK" Else $str = "ObjCreate() FAILED!" EndIf MsgBox ( 0, "ObjCreate() results", $str ) EndFunc =>openNew Func MyErrFunc ( ) $str = "We intercepted a COM Error !" & & & _ "err.description is: " & & $oMyError. number is : 8007000EĮxpand collapse popup Opt ( 'MustDeclareVars', 1 ) #include Global $oMyError, $oExcel, $str _Main ( ) Exit ( 1 ) Func _Main ( ) Local $str $oMyError = ObjEvent ( "AutoIt.Error", "MyErrFunc" ) Initialize a COM error handler If IsObj ( $oMyError ) Then windescription : Not enough storage is available to complete this operation. Here is the error info: We intercepted a COM Error !Įrr. helpcontext ClipPut ( $str ) MsgBox ( 0, "AutoItCOM Test", $str & & "(results are in the clipboard)" ) Exit ( 1 ) EndFunc =>MyErrFunc

description & & _ "err.windescription:" & & $oMyError. Expand collapse popup 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 !" & & & _ "err.description is: " & & $oMyError.
