How to use macro-enabled files in Power Automate flows
You can integrate your .xlsm files with a Power Automate flow. This lets you start to convert your existing automation solutions to web-based formats. Please note that the macros contained in the .xslm files cannot be run through Power Automate. Only Office Scripts are enabled there.
The Excel Online (Business) connector in Power Automate is typically limited to files in the Microsoft Excel Open XML Spreadsheet (.xlsx) format. Its file browser only lets you select .xlsx files. However, macro-enabled files are compatible with the connector's Run script action if the file metadata is used.
In your flow, use the Get File Metadata action from either the OneDrive for Business or SharePoint connectors. The Run script action accepts this metadata as a valid file. Use the ID dynamic content returned from the Get file metadata action as the "File" argument when running the script. The following screenshot shows a flow providing the metadata for a file called "Test Macro File.xlsm" to a Run script action.
Warning
Some .xlsm files, especially those with ActiveX or Form controls, may not work in the Excel online connector. Be sure to test before deploying your solution.
Other resources
Watch Sudhi Ramamurthy's YouTube video on how use an .xlsm file in a Run Script action.
Feedback
Submit and view feedback for