VBA & Macro Problems

How to Fix Excel Macros Blocked in a OneDrive File

Tauseeq MagsiTauseeq Magsi Nov 10, 2026 869 views

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.

How to Fix Excel Macros Blocked in a OneDrive File
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Windows Security

Click the Windows Start menu, type 'Windows Security' into the search bar, and press Enter to open the application.

2
Access Protection History

Navigate to 'Virus & threat protection' on the left sidebar, and then click on 'Protection history' under the current threats section.

3
Allow the Excel File

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.

4
Check Third-Party Antivirus Logs

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.

Check Antivirus and Microsoft Defender Settings
System Reboot May Be Required: After allowing the file through your antivirus software, you may need to completely close and reopen Excel, or restart your computer, for the changes to take effect.
Free Microsoft Office alternative

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. 1. Visit the WPS Website: Go to the official WPS Office website to download the latest version of the suite.
  2. 2. Install WPS Office: Run the installer and follow the on-screen instructions to set up WPS Office on your device.
  3. 3. Open Your Macro File: Launch WPS Spreadsheets and easily open your .xlsm files to start working with your macros right away.
Fully compatible with Microsoft Excel formats including .xlsx, .xlsm, and .csvBuilt-in support for VBA macros and advanced spreadsheet functionsFree, lightweight, and incredibly fast to launch on any deviceFamiliar user interface for a zero-learning-curve transition
microsoft office alternative - wps office

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.