logo
search
VBA & Macro Problems

How to Unblock VBA Macros from an Untrusted Excel File

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

The user needs to unblock and enable VBA macros within an Excel workbook that originated from an internet, network, or email source.

Product
Microsoft Excel
Device & OS
Windows
Scenario
Attempting to open and execute VBA scripts in an Excel file that was downloaded from an external or potentially untrusted source.
Observed behavior
Excel automatically blocks the VBA macros from running as a security precaution against potentially malicious code.
Before you start

Before proceeding to unblock any macros, ensure that you completely trust the sender and understand what the VBA code does, as malicious macros can seriously harm your computer system.

Solution 1Recommended

Unblock the Excel File via File Properties

This is the quickest and most direct method to allow macros for a single downloaded workbook without changing global Excel security settings.

1
Close the workbook

Ensure the blocked Excel file is completely closed before attempting to change its properties.

2
Open File Properties

Navigate to the file using Windows File Explorer, right-click on the downloaded Excel file, and select Properties from the context menu.

3
Unblock the file

Stay on the General tab and look for the Security section at the bottom. Check the box labeled Unblock, then click Apply and OK to save the changes.

Instant Access: Once unblocked, you can open the file normally in Excel, and the macros will be allowed to run according to your standard Trust Center settings.

Manage and Run VBA Macros Easily with WPS Spreadsheet

WPS Office offers robust support for VBA macros. You can seamlessly manage macro security settings and execute your VBA scripts smoothly in WPS Spreadsheet, an efficient and highly compatible office suite.

  1. 1. Access Developer Tools: Open WPS Spreadsheet and click on the Developer tab located in the top ribbon menu.
  2. 2. Configure Macro Security: Click on Macro Security to review and adjust your security level, such as setting it to 'Medium' so you are prompted before any macro runs.
  3. 3. Open the Macro-Enabled File: Open your trusted .xlsm or .xls file containing the VBA macros.
  4. 4. Enable Macros safely: When prompted by the security warning notification, click Enable Macros to safely run your trusted code.
Seamless compatibility with Microsoft Excel file formats (.xls, .xlsx, .xlsm)Built-in advanced developer tools and VBA editorEasily adjustable macro security levels for safe code executionLightweight installation and resource-friendly performance
QA img-9

Frequently Asked Questions

Why does Excel automatically block macros in downloaded files?

Windows uses a security feature called Mark of the Web (MOTW) to tag files downloaded from the internet or received as email attachments. Excel reads this tag and automatically blocks macros in these files to protect your system from potential malware and unauthorized code execution.

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

If the Unblock checkbox is missing, it means the file is not tagged with the Mark of the Web and Windows already trusts the file's origin. If macros are still failing to run, check your Excel Trust Center settings to ensure macro execution is enabled, or verify that a third-party antivirus program is not blocking the scripts.

How do I unblock multiple Excel files at once?

You can bypass the block for multiple files by moving them into an Office Trusted Location. Alternatively, advanced users can utilize a PowerShell command like 'dir "C:\YourFolder" | Unblock-File' to recursively remove the block from all files located within a specific directory.

Can I disable the macro blocking feature entirely?

While you can disable macro security warnings in the Trust Center by selecting 'Enable all macros', this is highly discouraged. Doing so overrides important security measures and makes your computer extremely vulnerable to malicious code.