How to Unblock VBA Macros from an Untrusted Excel File
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 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.
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.
Ensure the blocked Excel file is completely closed before attempting to change its properties.
Navigate to the file using Windows File Explorer, right-click on the downloaded Excel file, and select Properties from the context menu.
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.
Move the File to an Office Trusted Location
Ideal if you frequently receive safe macro-enabled files and want to store them in a pre-approved folder that bypasses the security block.
Unblock the File Using a PowerShell Command
Useful for advanced users or IT administrators who prefer command-line tools or need to unblock files rapidly.
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. Access Developer Tools: Open WPS Spreadsheet and click on the Developer tab located in the top ribbon menu.
- 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. Open the Macro-Enabled File: Open your trusted .xlsm or .xls file containing the VBA macros.
- 4. Enable Macros safely: When prompted by the security warning notification, click Enable Macros to safely run your trusted code.

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.




