logo
search
VBA & Macro Problems

How to Fix Excel Macro Blocked as a Security Risk in OneDrive

John WilsonJohn Wilson Oct 9, 2026 870 views

Question details

The user needs to unblock and run VBA macros in Excel workbooks that are stored in or synchronized via OneDrive, which are currently being restricted by Excel's security policies.

How to Fix Excel Macro Blocked as a Security Risk in OneDrive
Product
Microsoft Excel
Device & OS
not provided
Scenario
Attempting to open and execute VBA macros in an Excel workbook synced through OneDrive or SharePoint.
Observed behavior
Excel automatically blocks the VBA macros, displaying a red banner warning that the macros have been disabled due to a security risk because the file originated from the internet, even if macros are generally enabled in the user's settings.
Before you start

Before proceeding, ensure that the Excel workbook containing the macros comes from a trusted, verified source, as enabling macros from unknown internet sources can expose your device to malware.

Solution 1Recommended

Unblock the File via Windows Properties

Remove the Mark of the Web (MOTW) internet security attribute from the file to allow Excel to trust and run its macros.

Files synced or downloaded via OneDrive are often tagged by Windows as originating from the internet. By manually unblocking the specific file, you signal to Excel that the document is safe.

1
Close the Workbook

Ensure the affected Excel workbook is completely closed before attempting to change its properties.

2
Locate the File

Open Windows File Explorer and navigate to your OneDrive folder where the Excel file is stored.

3
Open File Properties

Right-click on the Excel file and select 'Properties' from the context menu.

4
Unblock the File

On the 'General' tab, look at the bottom for a Security section. Check the box labeled 'Unblock', then click 'Apply' and 'OK'.

Unblock the File via Windows Properties
Missing Unblock Option: If you do not see the 'Unblock' checkbox, the file may already be unblocked, or your organization's IT policies may prevent you from modifying this security setting.
Free Microsoft Office alternative

Try WPS Office for a Seamless Spreadsheet Experience

If strict macro security policies, OneDrive syncing issues, or complex Trust Center configurations are interrupting your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible, and user-friendly alternative for managing your spreadsheets and daily office tasks.

  1. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install WPS Office: Run the downloaded setup file and follow the simple on-screen instructions to install the suite.
  3. 3. Open Your Spreadsheets: Launch WPS Spreadsheets and open your .xlsm files to continue your work without unnecessary interruptions.
Fully compatible with Microsoft Office spreadsheet formats including .xlsx and .xlsmEasily open and manage your complex spreadsheets without restrictive cloud-sync security blocksLightweight application that installs quickly and runs smoothly on older or slower devicesFamiliar user interface ensuring a zero-learning-curve transition from Microsoft Excel
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel think my OneDrive file is from the internet?

Files downloaded or synchronized via OneDrive and SharePoint are often assigned a 'Mark of the Web' (MOTW) by Windows. This attribute signals to Microsoft Office applications that the file originated from an external cloud source, triggering strict macro security blocks to protect your system.

Can I bypass this by enabling all macros in Excel settings?

No. Recent security updates to Microsoft Office block internet-sourced macros regardless of whether you have selected 'Enable VBA macros' in the Trust Center. You must explicitly unblock the individual file or place it in a Trusted Location.

What should I do if the 'Unblock' checkbox is missing in file properties?

If the Unblock option is absent, the file might already be unblocked, it might be stored on a file system that doesn't support this attribute (like FAT32), or your organization's IT administrator may have deployed a group policy that restricts users from manually unblocking internet files. In the latter case, contact your IT department for assistance.