Отвечу сам себе:
#include <excel.au3>
Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")
Local Const $sMessage = "Выберите файл."
Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "XLS (*.xls)", 1)
local $sFilePath1 = ($sFileOpenDialog)
Local $oExcel = _ExcelBookOpen($sFilePath1)
$oExcel.VBE.ActiveVBProject.VBComponents.Import(@ScriptDir & "\\macro.bas")
$oExcel.Run("test")
Exit
; User's COM error function. Will be called if COM error occurs
Func _ErrFunc($oError)
; Do anything here.
ConsoleWrite("err.number is: " & tab & $oError.number & @CRLF & _
"err.windescription:" & tab & $oError.windescription & @CRLF & _
"err.description is: " & tab & $oError.description & @CRLF & _
"err.source is: " & tab & $oError.source & @CRLF & _
"err.helpfile is: " & tab & $oError.helpfile & @CRLF & _
"err.helpcontext is: " & tab & $oError.helpcontext & @CRLF & _
"err.lastdllerror is: " & tab & $oError.lastdllerror & @CRLF & _
"err.scriptline is: " & tab & $oError.scriptline & @CRLF & _
"err.retcode is: " & tab & $oError.retcode & @CRLF & @CRLF)
EndFunc ;==>_ErrFunc