logo
search
VBA & Macro Problems

How to Safely Unblock Excel Macros in Files from Email or OneDrive

Khadija KhanKhadija Khan Sep 29, 2026 868 views

Question details

The user needs to safely unblock and run Excel macros in files received via email or stored in cloud locations like OneDrive, which are blocked by default security settings.

How to Safely Unblock Excel Macros in Files from Email or OneDrive
Product
Microsoft Excel
Device & OS
Windows
Scenario
Attempting to open and execute a macro-enabled Excel file downloaded from an internet source, email attachment, or OneDrive.
Observed behavior
Excel blocks the macros from running due to Microsoft's default security controls applied to files originating from the internet or untrusted sources.
Before you start

Before proceeding, ensure you absolutely trust the sender and the source of the file, as enabling macros from unknown origins can expose your computer to malicious code.

Solution 1Recommended

Unblock the File in Windows File Explorer

The most direct way to allow macros in a specific downloaded file is to check the 'Unblock' box in its Windows file properties.

Microsoft applies a 'Mark of the Web' to files downloaded from the internet. Unblocking the file locally removes this flag and allows the macros to run.

1
Close the Excel application

Ensure that Microsoft Excel is completely closed before attempting to modify the file properties.

2
Locate the file

Open File Explorer and navigate to the folder where your downloaded macro-enabled file is stored. If it's on OneDrive, download a copy to a local folder first.

3
Open file properties

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

4
Unblock the file

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

5
Test the macro

Open the file in the Excel desktop app rather than the web browser to verify that the macros can now run safely.

Unblock the File in Windows File Explorer
Missing Unblock Option?: If you don't see the Unblock checkbox, the file might not be tagged as coming from the internet, or it is stored in a synced cloud folder. Try moving it to a standard local folder like Desktop or Documents first.
Free Microsoft Office alternative

Try WPS Office for a Seamless Spreadsheet Experience

Tired of dealing with complex security settings and macro blocks? WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office. It offers a familiar interface, making it easy to manage your spreadsheets, documents, and presentations without the hassle.

Highly compatible with Microsoft Excel formats (.xls, .xlsx, .xlsm).Lightweight design ensures fast installation and quick file loading.Free to use with a familiar, easy-to-navigate tabbed interface.Seamless migration with no learning curve required.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel block macros from email or OneDrive by default?

Microsoft blocks macros from internet sources by default to protect users from malicious code like malware or ransomware that often hide within downloaded Office files. This is a security feature known as 'Mark of the Web'.

Should I enable all macros in the Trust Center?

No, it is highly discouraged to enable all macros globally. Doing so makes your computer vulnerable to potentially dangerous code. Always use the least-permissive setting and only unblock specific trusted files or use Trusted Locations.

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

If the checkbox isn't there, the file is either already unblocked, or your system doesn't flag it as originating from the internet. If macros still don't run, check your Excel Trust Center settings or consult your IT administrator regarding group policies.

Can I run blocked macros in Excel for the web?

No, Excel for the web does not support running VBA macros regardless of security settings. You must download the file and open it in the desktop version of Excel to execute macro code.