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 / Excel Macros will not ...
Power Automate
Unanswered

Excel Macros will not run when opened with PAD only!

(0) ShareShare
ReportReport
Posted on by 12

Hi All,

 

In need of some help!

 

Prev I wasted many hours trying to get a global macro to work to no avail. Months later figured have another use and maybe try with a local macro to the workbook in use.

 

I have seen many people with issues when running macros in excel with PAD. Most solutions involve editing the name of the macro, workbook or module however none of these work for me.

 

I can now see that like some others, when PAD opens the file, it thinks macros are disabled even though they are not. I can see the options are still ticked and if I open the workbook manually, all works fine.

 

I can see that some people have an extra option when launching excel to toggle on macros however this is not appearing in my function (assuming removed after updates since those posts).

 

only workaround I can see is to emulate the keys to open macro box and run however I still get same issue: macros have been disabled. To run reopen and enable macros. For more info click help.

 

At this point I need to ask - what in the parent of good times is going on?

 

Any help would be absolutely hugely appreciated! 

  • alee001 Profile Picture
    422 on at

    As far as I know, there are two ways to use PAD to execute simple Marco in Excel:
    1) Open Excel and execute the Excel macro
    2) Use UI elements to press macros within Excel
    If there are userform and multiple items to be executed in the macro, it is necessary to use UI elements and modify the selector to proceed.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    There is no toggle in the Launch Excel action to enable macros. If they are disabled when you launch Excel, you could go with one of the two approaches: 

    1. Use Launch Excel making the instance visible, and then use Press button in window or Click UI element in window to click on the Enable button in Excel to enable macros.
    2. Use scripting (Run PowerShell script or Run VBscript) to run Excel with macros enabled (passing that as the parameter of the script) and then use Attach to running Excel to attach to it.

    Once the macros are enabled and you have an Excel instance created by either Launch Excel or Attach to running Excel, you can use the Run Excel macro action.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • V1k Profile Picture
    12 on at

    Hi both, thanks so much for taking the time to write back, really appreciate any help or guidance with this.

     

    I can confirm there are no user forms present. The macro is actually just to add a top border to each row that contains text in a certain column.

     

    Just to clarify, macros are actually enabled and they work when open excel manually. When Power Automate errors and says make sure enabled I check the options within excel to confirm that they are still enabled before closing, which they are.

     

    At this point, even running the macro manually will not work as once the file has been opened by Power Automate, it seems to think they are no longer enabled.

     

    This is a huge issue, I have never been able to get macros to work with PA and seems this is the reason. Again I have seen other users reporting similar behaviour however in their cases it was advised to use shortcut keys to run the macro. Again this does not work as once opened by PA macros seem to become useless. I can't see how it could have solved the issue for anyone else in this scenario either.

     

    Is it just me or is it just my instance of excel/PA (both up to date) that shows there is a major issue with excel macros? Just in case, using up to date Win 10 also.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Okay, another attempt. You shouldn’t have to do this, but since you seem to be having trouble the natural way:

     

    Open Excel.exe using command line. 

    use the ui navigation to File->Open -> Browse -> send keys path and enter -> send keys filename and enter

    Then attach to Excel. 

    good luck!

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    I would suggest using Run application instead and run the Excel file, which will in turn run the Excel app, too. Then use Attach to running Excel to attach to it.

    No need to run it via CMD, nor use the UI (and especially keystrokes) to open the document.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • MelvinOrellana Profile Picture
    on at

    I have a similar problem. But in my case the macros are enabled, the flow has been working for months with no problem and today it started to give me an error in the run macro step. With the excel instance open I can run the macro manually with no problem, but the action of running the macro just stoped working and I haven't made changes to anything.

     

    Edit: Something else, when I run the flow outside of the editor it is not giving me any error messages, it just end the excecution and leaves the excel instance open.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Is it possible the name of the macro got changed?  Check the naming convention of the macro versus the command in PAD.

    Otherwise, no clue.  Maybe try deleting that command and replacing it.  Possible an update didn't convert and replacing the command could reset it to the new language syntax (style).  It's worth a shot.

    Best of luck!

  • MelvinOrellana Profile Picture
    on at

    Thanks, but it didn't work. I made sure that I have power automate updated in all my computers, deleted and replaced the command, I even tried creating a new flow, I tried other workbooks with macros in those workbooks and the personal.xlsb workbook. I checked the names of the macros and the configuration of the command that creates the instance of excel. So far nothing has worked.

  • V1k Profile Picture
    12 on at
    Hi Michael, apologies for late reply as ended up having to take some time off from work. I can see what you are saying and think that this might work. As there are 4 files needing to be opened and running macros contained within their respective workbooks, this is a little annoying but as only a 1 off definitely worth investigating. Thanks again and I hope to update once get back to working on this particular issue.
  • V1k Profile Picture
    12 on at

    Hi Agnius, apologies for late reply as ended up having to take some time off from work. I can see what you are saying and think that this might work. As there are 4 files needing to be opened and running macros contained within their respective workbooks, this is a little annoying but as only a 1 off definitely worth investigating. Thanks again and I hope to update once get back to working on this particular issue. 

    Also thanks again to both you and Michael for taking the time to help, much appreciated!

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard