How to Enable Macros for Excel Files in a Shared OneDrive Folder
Question details
The user needs to enable macros in an Excel workbook that is stored in a shared OneDrive folder, but the macros are being actively blocked by security settings.

- Product
- Microsoft Excel, OneDrive
- Device & OS
- not provided
- Scenario
- Attempting to open and run a macro-enabled Excel file (.xlsm) located within a shared OneDrive directory.
- Observed behavior
- Macros remain blocked or disabled due to Excel's strict security policies regarding files originating from network locations or the internet.
Before enabling macros for any shared workbook, ensure that you completely trust both the file's author and the shared OneDrive location, as malicious macros can compromise your system's security.
Add the OneDrive Shared Folder to Excel's Trusted Locations
Designating the shared OneDrive folder as a Trusted Location in Excel will bypass the default macro-blocking security prompts for any files stored within it.
By default, Excel treats files from shared networks and the internet with high suspicion. Adding your synced OneDrive folder to the Trusted Locations list tells Excel that files in this specific directory are safe to run.
Launch Microsoft Excel, click on 'File' in the top-left corner, select 'Options', and then click on 'Trust Center' from the left-hand pane. Click the 'Trust Center Settings' button.
In the Trust Center window, select 'Trusted Locations' from the left menu. If your OneDrive folder is on a network, ensure 'Allow Trusted Locations on my network' is checked at the bottom.
Click 'Add new location'. Browse to the local path of your shared OneDrive folder. Check the box that says 'Subfolders of this location are also trusted'.
Click 'OK' on all dialog boxes to save the settings. Restart Excel and open the macro-enabled file from the OneDrive folder to verify the macros are running.

Unblock the Individual Excel File via File Properties
If only a single file is being blocked due to the 'Mark of the Web' (MotW) security feature, you can unblock it directly from its properties.
Review Microsoft 365 Policy Settings with an IT Administrator
If the options to unblock files or add trusted locations are disabled, your organization's IT policies may be strictly blocking network macros.
Try WPS Office for a Smoother Spreadsheet Experience
If Microsoft Excel's strict macro security settings and Mark of the Web blocks are disrupting your workflow, consider using WPS Office. It provides excellent compatibility with Microsoft Office formats, a familiar interface, and straightforward macro management, all in a lightweight package.
- 1. Download and Install: Download WPS Office for free from the official website and run the installer.
- 2. Open Your Workbook: Launch WPS Spreadsheet and open your .xlsm file directly from your synced OneDrive folder.
- 3. Manage Macros: Use the developer tab to easily enable or manage your macros safely and efficiently.

Frequently Asked Questions
Why does Excel automatically block macros in my OneDrive shared folder?
Microsoft recently updated its security policies to automatically block VBA macros in files originating from the internet or network locations (known as Mark of the Web) by default. This is a security measure designed to protect users from malicious code often distributed via shared files.
Can I simply enable all macros in the Trust Center?
While you can go to File > Options > Trust Center > Trust Center Settings > Macro Settings and select 'Enable VBA macros', this is highly discouraged. Enabling all macros universally exposes your computer to significant security risks, as harmful code could execute automatically without warning.
What if the 'Unblock' checkbox is missing in the file properties?
If the 'Unblock' option is missing, it usually means the file has already been unblocked, or it is stored in a location not recognized as an internet zone. Alternatively, if you are on a company device, your IT administrator may have deployed a strict policy that prevents users from manually unblocking files.




