Can Power Automate Run Excel VBA Macros in SharePoint Online?
Question details
The user wants to configure Power Automate to automatically trigger a VBA macro every hour within an Excel workbook hosted in a SharePoint folder.
- Product
- Power Automate, SharePoint Online, Excel
- Device & OS
- not provided
- Scenario
- Automating recurring business processes by running an existing VBA macro directly from a cloud storage environment (SharePoint) on an hourly schedule.
- Observed behavior
- The user is seeking a method or confirmation on whether a cloud-based flow can execute local VBA code without manually opening the desktop application.
Keep in mind that traditional VBA macros require the desktop version of Excel to execute, which introduces compatibility challenges for cloud-only automation services.
Seek Guidance from the Microsoft Power Platform Community
Since cloud execution of desktop macros involves complex workarounds, consulting dedicated Power Automate engineers is the official recommendation.
VBA is inherently a desktop technology, while Power Automate operates in the cloud. Directly triggering a VBA macro inside SharePoint Online using a standard cloud flow is generally not supported natively.
Microsoft engineers and experienced automation professionals in the Power Platform Community can evaluate your specific use case and suggest exact architecture solutions.
Navigate to the official Microsoft Power Platform Community website in your browser.
Select the 'Power Automate' section to ensure your query reaches the right experts.
Create a new thread explaining that you need an hourly trigger for an Excel workbook stored in a SharePoint folder, and ask if a Desktop Flow or alternative is required.
Alternative: Use Office Scripts for Cloud Automation
Convert your existing VBA code into Office Scripts, which are natively supported by Power Automate and Excel on the web.
Need a Reliable Desktop Suite for Local Macros?
If cloud automation proves too restrictive and you prefer running and managing your VBA macros locally, WPS Office is an excellent, lightweight alternative. It provides high compatibility with Microsoft Office files and powerful tools without the hefty subscription fees.
- 1. Download the Installer: Visit the official WPS website and download the free version of the suite.
- 2. Install WPS Office: Run the setup file and follow the quick installation prompts on your desktop.
- 3. Open Macro Files: Launch WPS Spreadsheets and open your .xlsm files to continue working on your data locally.

Frequently Asked Questions
Can Power Automate trigger an Excel macro on a closed file?
No, traditional VBA macros require the Excel desktop application to be open to execute. Power Automate cloud flows cannot natively open a desktop application to run these macros.
What is the best cloud alternative to Excel VBA?
Office Scripts are the modern, cloud-first alternative to VBA. They are written in TypeScript, run in Excel on the web, and integrate perfectly with Power Automate.
Does SharePoint Online natively run VBA scripts?
SharePoint Online acts as a cloud storage repository and does not have a native execution engine for VBA scripts, which are strictly desktop-based.
Can I use Power Automate Desktop to run my macros?
Yes. Power Automate Desktop (RPA) can be scheduled via a cloud flow to open Excel on a physical or virtual machine, run the macro, and save the file back to SharePoint, though this requires premium licensing and dedicated machine setup.




