How to Fix Excel Macro Blocking for OneDrive or SharePoint Files
Question details
The user needs to resolve an issue where Excel blocks macros in workbooks stored in shared OneDrive or SharePoint locations.

- Product
- Microsoft Excel
- Device & OS
- Windows
- Scenario
- Accessing a macro-enabled workbook owned by the user but accessed via a shared OneDrive folder on a different computer.
- Observed behavior
- Excel displays a security warning and blocks the macros from running because the shared cloud location is considered an untrusted origin, even after applying a local digital signature.
Ensure you have the password for the VBA project if it is protected, and verify that you have administrative rights on your Windows PC to modify Trust Center settings or install digital certificates.
Add the OneDrive or SharePoint Path to Excel Trusted Locations
Configuring Trust Center settings to recognize your shared cloud folder as a safe location prevents Excel from blocking the macros.
When a file is opened from a cloud location like OneDrive or SharePoint, Excel treats it as an internet location. Adding this specific sync path to your Trusted Locations will bypass the untrusted origin security block.
Launch Excel, navigate to 'File' > 'Options' > 'Trust Center', and then click the 'Trust Center Settings' button.
Select 'Trusted Locations' from the left sidebar and click on the 'Add new location' button at the bottom.
If your SharePoint or OneDrive is mapped as a network drive, ensure you check the box for 'Allow Trusted Locations on my network (not recommended)' first.
Type or paste the exact local path of your synced OneDrive or SharePoint folder into the path field. Check 'Subfolders of this location are also trusted' if necessary, and click 'OK'.

Install the Local Digital Certificate in Windows
If you signed the VBA project with a local certificate, you must install that specific certificate on the secondary computer accessing the shared file.
Unblock the File in Windows File Explorer
Removes the 'Mark of the Web' security attribute from files synced from the internet, which forces Excel to block their macros.
Experience Hassle-Free Spreadsheets with WPS Office
If Microsoft Excel's strict cloud security policies continue to block your workflow, consider using WPS Office. It provides a lightweight, highly compatible alternative with robust spreadsheet capabilities and a familiar interface, completely free of charge.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package.
- 2. Install the Software: Run the installer and follow the on-screen instructions to set up WPS Office on your computer.
- 3. Open Your Workbooks: Launch WPS Spreadsheets and open your .xlsm files to continue working seamlessly.

Frequently Asked Questions
Why do macros get blocked when opening files from OneDrive or SharePoint?
Microsoft applies a 'Mark of the Web' security feature to files originating from the internet or cloud locations. By default, modern versions of Excel block macros in these files to protect your computer from potentially malicious code.
Does creating a local digital signature bypass Excel's macro blocking?
It only bypasses the block on the specific machine where the signature was created. For other users or computers accessing the shared file via OneDrive, the local certificate must be manually installed in their local Trusted Publishers store.
What should I do if my OneDrive file retains an untrusted origin even after unblocking?
Sometimes synced SharePoint or OneDrive locations continuously re-apply the security tag upon syncing. You may need to add the local sync folder path directly to your Excel Trusted Locations, or contact your IT administrator to adjust organizational security policies.




