web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error running an excel...
Power Automate
Answered

Error running an excel macro

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I am trying to run an excel macro via PAD but I keep receiving the following error message: 'Failed to run macro (make sure the macro containing file isn't included in the disabled items list).'

 

PAD error.png

 

I checked the disabled items list and there is nothing there. I checked the field 'Trust access to the VBA project object model' as well.

 

Also, when I launch the excel containing this macro I enable the option 'Load add-ins and macros'.

 

Does anyone have any idea why this is happening?

 

Thanks

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Just in case someone comes across the same issue, I found the solution.

     

    The macro name must be the same as the one you find at Developer > Macros. In my case I was inserting "Book1.xlsm!MacroName" but for some reason the first part had to be changed and the final result should be "ThisWorkbook.MacroName".

     

    The documentation for WinAutomation helped me a lot: https://docs.microsoft.com/en-us/previous-versions/troubleshoot/winautomation/process-development-tips/excel-automation/how-to-use-run-excel-macro-action

     

    Thanks

  • AnaShrivastav Profile Picture
    3 on at

    Thanks a ton. I was getting the same error and after changing the Macro name as per the format suggested by you, the flow worked. Thank you again. 😀

  • sarfraj Profile Picture
    2 on at

    It still didn't worked for me, i changed the macro name and i still gets same error, any further solution or any other idea ?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If you're Macro Workbook and the workbook you are trying to use the macro on are different, you cannot open both with the Launch Excel feature.  You must open your macro workbook first, and then open the other workbook using File -> Open.  This will ensure that the second workbook has access to the macros.

  • mmahrous1 Profile Picture
    2 on at

    Thank you, that was awesome of you. 

  • aebarnes Profile Picture
    4 on at

    This is exactly what I am trying to do, but I can't find how I can open another Excel file without using the Launch Excel function. Any further explanation?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Reposting so you don't have to look for it:

    If you're Macro Workbook and the workbook you are trying to use the macro on are different, you cannot open both with the Launch Excel feature.  You must open your macro workbook first, and then open the other workbook using File -> Open.  This will ensure that the second workbook has access to the macros.

     

    You can then "Attach to Excel" on the workbook you want to work in and run the macro from there.

     

    Good luck.

  • aebarnes Profile Picture
    4 on at

    Thanks! Using the "Attach to Excel" function does not seem to be working. I am getting the error that the workbook I am trying to pull up does not exist. Any thoughts on why? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 229 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 223 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard