How to Use Excel and PowerPoint Macros in SharePoint Online
Question details
Users need to know how to effectively store, synchronize, and execute macro-enabled Excel and PowerPoint files using SharePoint Online without encountering security blocks or synchronization issues.

- Product
- Microsoft Excel and PowerPoint
- Device & OS
- not provided
- Scenario
- Collaborating on and executing macro-enabled files stored in SharePoint Online.
- Observed behavior
- Users experience issues running macros from SharePoint document libraries, handle linked macro files with slow OneDrive synchronization, and struggle with appropriate Trust Center configurations.
Ensure you have the desktop versions of Microsoft Excel or PowerPoint installed, as VBA macros cannot be executed in the web versions of these applications. You must also have permissions to modify your local Trust Center settings.
Open Macro-Enabled Files in the Desktop Application
Since web applications do not support macros, you must open your SharePoint files directly in the desktop versions of Excel or PowerPoint.
SharePoint Online allows you to store macro-enabled files (.xlsm, .pptm), but attempting to run them in the browser will fail. Opening them in the desktop app ensures full macro functionality while keeping the file synchronized with SharePoint.
Open your web browser and navigate to the SharePoint Online document library where your macro-enabled files are stored.
Click the three dots (ellipsis) next to your target .xlsm or .pptm file to open the context menu.
Select 'Open' and then choose 'Open in Desktop App'. The file will launch in your local Excel or PowerPoint application where macros can be executed.

Configure Trust Center Security Settings
Add your SharePoint document library to trusted locations to prevent Office from blocking your macros.
Manage Linked Macro Files via OneDrive Desktop App
Ensure linked files containing macros are properly synchronized and accessible by utilizing the local OneDrive sync client.
A Lightweight Alternative for Macro-Enabled Files
If configuring complex Trust Center settings and managing SharePoint sync issues is slowing down your workflow, consider WPS Office. It is a highly compatible, free, and lightweight alternative to Microsoft Office that easily handles your macro-enabled documents locally or via your preferred cloud storage.
- 1. Download and Install: Visit the official WPS Office website to download and install the free, lightweight suite.
- 2. Open Your Files: Launch WPS Office and easily open your existing .xlsm or .pptm files.
- 3. Edit and Save: Edit your documents with a familiar interface and save them in their original Microsoft formats.

Frequently Asked Questions
Can I run macros in Excel Online or PowerPoint Online?
No, macros and VBA code cannot be executed in the web versions of Excel or PowerPoint. You must open the macro-enabled file in the desktop application to run them.
Why are my SharePoint macros being blocked by default?
Microsoft Office blocks macros originating from internet locations, including SharePoint, as a security precaution. You need to add the SharePoint site to your Trusted Locations in the Trust Center to run them safely.
How do I handle slow synchronization with macro files?
Slow synchronization often occurs when multiple users attempt to co-author a complex macro-enabled file simultaneously. Limit concurrent editing and ensure that any linked files are stored locally via the OneDrive desktop sync app.
Is it safe to select 'Enable all macros' in the Trust Center?
No, it is highly discouraged. Selecting 'Enable all macros' allows any macro, including potentially malicious ones, to run automatically without warning. The recommended setting is 'Disable all macros with notification'.




