How to Safely Unblock Excel Macros in Files from Email or OneDrive
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.

- 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 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.
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.
Ensure that Microsoft Excel is completely closed before attempting to modify the file properties.
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.
Right-click the Excel file and select 'Properties' from the context menu.
On the 'General' tab, look for a 'Security' section at the bottom. Check the box labeled 'Unblock', then click 'Apply' and 'OK'.
Open the file in the Excel desktop app rather than the web browser to verify that the macros can now run safely.

Add the File to a Trusted Location
If you frequently receive safe macro files, setting up a Trusted Location in Excel bypasses the need to unblock each file individually.
Contact Your IT Administrator
If the file is still blocked after trying standard methods, your organization's group policies might be preventing macro execution entirely.
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.

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.




