How to Fix Excel Macros Blocked in a OneDrive File
Question details
The user is unable to run macros in an Excel file shared via OneDrive due to security blocks, even after adjusting Trust Center settings and moving the workbook to a trusted location.

- Product
- Microsoft Excel / OneDrive
- Device & OS
- not provided
- Scenario
- Attempting to run macros in a shared or downloaded OneDrive Excel workbook.
- Observed behavior
- Excel completely blocks the macros, and changing standard Trust Center settings or downloading the file to a trusted location does not resolve the issue for a specific user.
Ensure that the macro-enabled workbook (.xlsm) originates from a trusted source and that you have administrator privileges to modify Windows security or antivirus settings if necessary.
Check Antivirus and Microsoft Defender Settings
Antivirus software, including Microsoft Defender, can override Excel's standard Trust Center settings and block macros from running as a security precaution.
Even if a file is located in a Trusted Location, active antivirus scanning may intercept and neutralize VBA code execution if it flags the file as a potential threat. Adjusting the protection history settings can resolve this.
Click the Windows Start menu, type 'Windows Security' into the search bar, and press Enter to open the application.
Navigate to 'Virus & threat protection' on the left sidebar, and then click on 'Protection history' under the current threats section.
Look for a recently blocked threat that matches the time you tried opening the Excel file. Click on the blocked item, select 'Actions', and choose 'Allow on device' to permit the macro to execute.
If you are using a third-party antivirus program (such as McAfee or Norton), open its quarantine or security logs to manually restore and whitelist the specific Excel file.

Manually Unblock the File Properties
Windows attaches a 'Mark of the Web' (MOTW) to files downloaded from OneDrive or the internet, which forces Excel to block macros regardless of Trust Center configurations.
Verify Organizational Security Policies
If you are using a work or school computer, IT administrators may have deployed Group Policies that strictly block VBA macros from running in internet-sourced files.
Try WPS Office for Seamless Spreadsheet Management
If you are constantly battling restrictive macro security issues or compatibility problems with Microsoft Excel, consider switching to WPS Office. It is a powerful, free alternative that supports VBA macros, offers high compatibility with Microsoft formats, and provides a familiar user interface without the complicated security hurdles.
- 1. Visit the WPS Website: Go to the official WPS Office website to download the latest version of the suite.
- 2. Install WPS Office: Run the installer and follow the on-screen instructions to set up WPS Office on your device.
- 3. Open Your Macro File: Launch WPS Spreadsheets and easily open your .xlsm files to start working with your macros right away.

Frequently Asked Questions
Why does Excel say 'Security Risk: Microsoft has blocked macros' even in a trusted location?
This happens due to the 'Mark of the Web' (MOTW) applied to files downloaded from OneDrive or the internet. Windows marks the file as originating from an external source, overriding standard Trust Center settings until it is manually unblocked in the file's properties.
Can my company's IT policy override my local Excel macro settings?
Yes. IT administrators can use Group Policy or Microsoft Intune to enforce strict macro-blocking policies across all company devices, preventing individual users from enabling macros locally regardless of Trust Center configurations.
Does WPS Office support macros from Excel?
Yes, WPS Office Pro and specific customized versions of WPS Office fully support VBA macros. You can open, edit, and run .xlsm files seamlessly without having to navigate complicated security workarounds.




