logo
search
VBA & Macro Problems

How to Enable Macros for Excel Files in a Shared OneDrive Folder

Aamir Naveed AkramAamir Naveed Akram Oct 9, 2026 869 views

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.

How to Enable Macros for Excel Files in a Shared OneDrive Folder
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 you start

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.

Solution 1Recommended

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.

1
Open Trust Center Settings

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.

2
Navigate to Trusted Locations

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.

3
Add the OneDrive Path

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'.

4
Apply and Restart

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.

Add the OneDrive Shared Folder to Excel's Trusted Locations
Sync Client Requirement: This method works best if you are syncing the shared OneDrive folder to your local computer using the OneDrive desktop app, allowing you to select a local directory path (e.g., C:\Users\Name\OneDrive).
Free Microsoft Office alternative

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. 1. Download and Install: Download WPS Office for free from the official website and run the installer.
  2. 2. Open Your Workbook: Launch WPS Spreadsheet and open your .xlsm file directly from your synced OneDrive folder.
  3. 3. Manage Macros: Use the developer tab to easily enable or manage your macros safely and efficiently.
Fully compatible with Microsoft Excel formats, including macro-enabled workbooks (.xlsm).Straightforward macro security settings to keep your work safe without overly complex blocks.Free, lightweight, and easy to install across multiple devices and operating systems.Familiar user interface ensures a seamless migration from Microsoft Office.
microsoft office alternative - wps office

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.