logo
search
VBA & Macro Problems

How to Fix Shared Excel Macros Not Running from OneDrive

Emma BrownEmma Brown Oct 23, 2026 868 views

Question details

Users are unable to run macros in a shared Excel workbook stored on OneDrive, even though the macros execute successfully for the original file creator.

How to Fix a Shared Excel Macro That Will Not Run from OneDrive
Product
Microsoft Excel, OneDrive
Device & OS
Windows
Scenario
Attempting to open and execute VBA macros in a shared macro-enabled workbook (.xlsm) synced or downloaded via OneDrive.
Observed behavior
The macro is blocked from running by the recipient's system security settings, often without a clear error message, despite working perfectly for the workbook's author.
Before you start

Verify that the shared workbook is saved in the Macro-Enabled Workbook format (.xlsm) and ensure your local OneDrive client is fully synced with the cloud.

Solution 1Recommended

Add OneDrive to Windows Trusted Sites

Adding the OneDrive network path to your Trusted Sites prevents Windows from automatically blocking macros in files hosted on Microsoft's cloud servers.

When you open a file from a network location, Windows relies on Internet Options to determine if the source is secure. Adding the specific live.net URL ensures OneDrive files bypass strict network macro blocks.

1
Open Internet Options

Press the Windows key, type 'Internet Options' into the search bar, and press Enter to open the Internet Properties dialog box.

2
Navigate to Trusted Sites

Click on the 'Security' tab at the top of the window, then click on the green checkmark icon labeled 'Trusted sites'.

3
Add the OneDrive URL

Click the 'Sites' button. In the 'Add this website to the zone' field, type 'https://d.docs.live.net' and click 'Add'.

4
Save and restart

Click 'Close', then click 'OK' to apply the settings. Restart Microsoft Excel and attempt to run the macro again.

Add OneDrive to Windows Trusted Sites
Check Security Notifications: After restarting Excel, watch for a yellow security warning bar below the ribbon. You may still need to click 'Enable Content' to allow the macros to run.
Free Microsoft Office alternative

Try WPS Office for Seamless Macro Compatibility

If you are tired of troubleshooting complex Microsoft Excel security settings and network restrictions, WPS Office offers a powerful, lightweight alternative. It fully supports VBA macros, guarantees high compatibility with Excel (.xlsm) formats, and delivers a familiar interface with fewer syncing hurdles.

  1. 1. Download the software: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install WPS Office: Run the installer and follow the simple on-screen instructions to set up WPS Office on your computer.
  3. 3. Open and run your macros: Open your macro-enabled workbook (.xlsm) directly in WPS Spreadsheet to securely and easily run your VBA scripts.
Full compatibility with Microsoft Excel .xls, .xlsx, and .xlsm formats.Robust VBA macro support for advanced data processing and automation.Lightweight installation with straightforward file security management.Familiar user interface makes your transition seamless and effortless.
microsoft office alternative - wps office

Frequently Asked Questions

Why do Excel macros run for the creator but not for me on OneDrive?

The file creator's computer automatically trusts the workbook they authored. When you access it via OneDrive, your system's security settings treat it as a file originating from the internet. Consequently, Windows applies a safety measure known as the 'Mark of the Web' and blocks the macros to protect your computer.

What is the https://d.docs.live.net URL used for in Trusted Sites?

This specific URL is the network path Microsoft uses to map personal OneDrive accounts. By adding it to your Windows Trusted Sites, you inform the operating system that files hosted on this server are safe, preventing Excel from automatically disabling embedded macros.

Is it safe to enable macros in a shared workbook?

You should only enable macros if you completely trust the person who created the file and understand the macro's function. Malicious macros can execute harmful code on your computer, which is why Excel disables them by default for shared or internet-downloaded files.

Why can't I find the 'Unblock' option in my file properties?

The 'Unblock' checkbox only appears if Windows has actively flagged the file as coming from another computer or the internet. If the option is missing, the file is already unblocked on your local drive, meaning the macro issue is likely caused by Excel's Trust Center settings instead.