"Run Spreadsheet Macro" saying that I Cannot run the macro


I’m getting the following error message when I try to run my robot:
“Run Spreadsheet Macro: Cannot run the macro ‘A_ImportTemplateAndClearOutOldData’. The macro may not be available in this workbook or all macros may be disabled.”

I’ve tried researching the solution to this question elsewhere but I think all other solutions are only applicable to earlier versions of UiPath(ie saying I should use “invoke VBA”), so I think I need a new solution.

I’ve included a screenshot of the UiPath workflow below to show which activities I’m using.

Things I’ve tried/verified:

  1. I’ve enabled All macros in the excel workbook
  2. the workbook i’m using is an XLSM file type
  3. in my trust center settings, i’ve made sure that “Trust Access to the VBA project object model” option IS checked.
  4. I’ve been able to initiate the macros in the file myself by manually kicking them off(not a problem with the macro itself.

I did notice that the “Project_Notebook” has been popping up after I start up the robot, so I don’t know if that’s potentially interfering with the robot from initiating the macro.

Any help would be greatly appreciated!


Please try enabling activex as well…

And also I see it is a network location…to check can you try by moving to local…

And generally the sequence of excel is

Excel process scope → use excel file → run spreadsheet macro


Hi Anil,

Thanks for your reply.

When you say enable ActiveX, how do I go about doing that?

I also just tried running the robot on a local file, but that didn’t work. I also updated the Sequence as you recommended: Excel process scope → use excel file → run spreadsheet macro, but those didn’t address the problem.


Hi Anil,

I actually figured out what you were referring to with ActiveX. I just updated that in my settings(screenshot below), but i’m still getting the same error message. Any other ideas as to what’s causing the error?


Hi Anil,

I figured it out! I had saved my macros under a certain spreadsheet as opposed to putting them in a Module. I guess I wasn’t being detailed enough with my descriptions.

So I should have originally listed my macro as “Sheet1.A_ImportTemplateAndClearOutOldData” instead of “A_ImportTemplateAndClearOutOldData”.

for anyone else out there with this issue, if you switch the option to “All open workbooks” like in the screenshot below, you’ll get the proper name you should put into the UiPath activity.



That’s great to know: thank you for the tips ! :smile:
Don’t forget to mention your answer as the solution, so the thread closes and thus helps other users :wink:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.