How to Fix Microsoft Blocked Macros in Untrusted OneDrive Excel Files
Question details
The user is unable to run macros in an Excel workbook opened from a shared OneDrive folder because Microsoft considers the file untrusted and automatically blocks the macros.

- Product
- Microsoft Excel
- Device & OS
- Windows
- Scenario
- Opening a macro-enabled Excel workbook downloaded or synced from a shared OneDrive folder where Internet macros are blocked by default.
- Observed behavior
- Excel displays a security warning indicating that macros have been blocked because the source of the file is untrusted.
Ensure that you completely trust the source of the shared OneDrive file, as malicious macros can pose a severe security risk to your computer and organization.
Unblock the File via Windows File Explorer
Use this method to manually remove the 'Mark of the Web' from a specific file, allowing Excel to trust it and run the included macros.
Microsoft blocks VBA macros in files originating from the internet by default. By modifying the file properties in Windows File Explorer, you can mark the workbook as safe.
Open Windows File Explorer and navigate to the shared OneDrive folder containing the blocked Excel workbook.
Right-click on the macro-enabled Excel file and select 'Properties' from the context menu.
On the 'General' tab, look for the Security section at the bottom. Check the 'Unblock' box if it is available.
Click 'Apply' and then 'OK' to save your changes. Reopen the workbook in Microsoft Excel to run your macros safely.

Verify Excel Trust Center Macro Settings
Check your application-level settings to ensure macros are permitted to run once the file itself is unblocked.
Edit Macro-Enabled Workbooks Seamlessly with WPS Office
If you frequently encounter restrictive Microsoft Office security policies that disrupt your workflow, consider switching to WPS Office. It provides a highly compatible, free, and lightweight alternative for editing Excel workbooks, including robust support for handling .xlsm files and VBA macros securely.
- 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite on your computer.
- 2. Open your workbook: Launch WPS Spreadsheet and open your .xlsm file directly from your OneDrive folder.
- 3. Manage macros: Navigate to the Developer tab to seamlessly view, edit, and run your VBA macros.

Frequently Asked Questions
Why does Microsoft Excel block macros from OneDrive?
Microsoft automatically blocks VBA macros in files originating from the Internet to prevent malicious scripts from executing. Files synced from shared OneDrive locations often receive a 'Mark of the Web' tag, triggering this default security block.
What should I do if the Unblock option is missing in Properties?
If the Unblock checkbox is not visible on the General tab, the file might not have the Mark of the Web, or your organization's IT department is using centralized policies to strictly manage macro permissions. You will need to contact your IT administrator for assistance.
Can I add the shared OneDrive folder to Excel's Trusted Locations?
Yes, you can add specific folders to Trusted Locations within Excel's Trust Center. However, this may not override organizational security policies or the default Microsoft block for internet-sourced files, making manual unblocking the more reliable solution.




