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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate to Run ...
Power Automate
Unanswered

Power Automate to Run Excel Macro

(0) ShareShare
ReportReport
Posted on by 53

I have a Excel macro that copies a specific sheet from the source workbook to a destination workbook, both are on SharePoint. The macro resides on the destination workbook. I wanted to create a scheduled flow to run the macro every business day but I'm having some issues.

My Power Automate version does not have "Run Excel Macro" action, so I am trying to use "Run Script" action which appears like it can be used to trigger a macro and not just a Office Script, and in the script field I tried a few things but it keeps giving the error that it's a Bad Request - unable to parse script reference.

I tried the following naming conventions for the script field:


Module1.CopySheet (Module name followed by procedure name)

Module1CopySheet (without the dot)
Daily Orders!Module1.CopySheet (Workbook name followed by module name followed by procedure name)

Daily Orders!Module1CopySheet (without the dot)

I even tried copying/pasting my entire macro to the script field but to no avail.

Can someone please advise on how I make this happen or if there is alternative method to run this routine job?

Categories:
I have the same question (0)
  • coolbeans23 Profile Picture
    53 on at

    Hmm....two different AI's said you can run Excel macros from Power Automate on cloud (they could possibly be wrong) using "Run Excel Macro" or "Run Script" action (which I only have the latter in my version). I don't have Office Scripts.

     

    It's not a matter of consolidating Excel files, that can be easily accomplished with Power Query or even using dynamic array functions (VSTACK). 

     

    Perhaps I can fill you in on more detail, the source workbook has a specific sheet that is connected to a database and displays data where some needs to be corrected, a user remediates any incorrect data in the database then refreshes the Excel sheet to see their changes reflected. My goal is to capture changes to the data for each day of the month to see what has been corrected (if any).  My destination workbook has a macro that makes a static copy version of the sheet from the source workbook and creates a new tab with the current date i.e. Orders 4.20.2024, Orders 4.21.2024, Orders 4.22.2024, etc. I just need an automated way for the macro to run every business day at 11pm (even if my computer is shut down), so I thought Power Automate could help accomplish this.

     

    Is there a way to code macros so it runs on it's own with any user action? Can Windows Task Scheduler run macros? Any other solutions?

  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @coolbeans23 

    I've had all sorts of suggestions from AI - its still hit and miss. I'm not an expert on macros so someone else might be able to help re coding scheduled macros or Windows Task Scheduler. Or have a google.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard