Skip to main content

Automation Anywhere - Excel Advance: Run Macro throws error Unable to run the Macro. to continue review the macro

I have tested the macro, and it works fine in .xlsm and macro has 8 Arguments. i have passed all the arguments 2 of them are null but then also i am getting this error

Solution Already tried

  1. Trust Center Enable macro and checked 2 options below that
  2. Tested Macro No error found
  3. No Excel is opened; only Macro.xlsm

Please Help

I created a very simple macro that accepts two parameters and puts those values in A2 and B2. I passed two values and ran the macro from Automation Anywhere without fail. I have the file attached here for you to test.

The macro name is Macro1 and needs two parameters. See if you can make this simple file work.

 


Hi ​@chandreshjadeja ,

 

When you write a macro code, use Exit Sub to exit or end a specific procedure at any point.
Ensure that a macro code contains only one instance of the End or End Sub statement to terminate the macro. If there is more than one instance of the statement, then on execution, the bot might fail with an error.

Consider the following example where you want to get an input box and exit the procedure if a user's reply is not a number:


Sub vba_exit_sub_example()
If IsNumeric(InputBox("Enter your age.", "Age")) = False Then
   MsgBox "Error! Enter a numeric value only."
   Exit Sub
Else
   MsgBox "Thank you."
End If
End Sub


Reply