Dmp Posted February 13, 2024 Posted February 13, 2024 Hello experts, I cannot determine why I am getting an error after I use the 'run' function to execute an excel marco. The macro runs successfully as result of the run code, however, after the macro has executed, the autoit script fails w/ the error below. "C:\User\Documents\tst-saveas-XXX.au3" (139) : ==> The requested action with this object has failed.: Local $iPIDXl = $oXlsmExcel.Run("RP_WB") Local $iPIDXl = $oXlsmExcel^ ERROR ->13:26:51 AutoIt3.exe ended.rc:1 +>13:26:51 AutoIt3Wrapper Finished. >Exit code: 1 Time: 58.71 Also, I've had to attach my autoit code specific to this issue below because I don't currently have permissions to upload a file to this site. 😞 Thank you much in advance. $oXlsmExcel = _Excel_Open(True, Default, Default, Default, True) Local $oWorkbook2 = _Excel_BookOpen($oXlsmExcel, $sMacroWbook) $oWorkbook3 = _Excel_BookAttach($sMacroWbook) WinActivate($oWorkbook2) Sleep(3000) ; $oXlsmExcel.Run("PivotTbleVBA.xlsm!RPIMOV_WB") Local $iPIDXl = $oXlsmExcel.Run("RPIMOV_WB") If @error Then MsgBox($MB_SYSTEMMODAL, "", "Error Running Macro" & $iPIDXl & @CRLF & "@error = " & @error & ", @extended = " & @extended) Else ProcessClose($iPIDXl) EndIf Sleep(8000) _Excel_BookClose($oWorkbook2)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now