VBA & Macro Problems

Fix Excel Workbook_Open Macro Not Running on File Open

Rana GarciaRana Garcia Nov 2, 2026 872 views

Question details

The user's Workbook_Open macro does not execute automatically when an XLSM file is opened.

How to Fix Excel Workbook_Open Macro Not Running Automatically
Product
Microsoft Excel
Device & OS
not provided
Scenario
Opening an Excel file (.xlsm) containing an automated Workbook_Open macro event.
Observed behavior
The macro fails to run automatically upon file opening due to macro security blocks, untrusted folder locations, or incorrect code placement.
Before you start

Verify that your file is saved as an Excel Macro-Enabled Workbook (.xlsm) and only proceed to enable macros if you fully trust the file's source, as malicious macros can pose significant security risks.

Solution 1Recommended

Add the File Folder to Trusted Locations

Excel blocks automatic macro execution for files opened from untrusted folders. Adding your specific folder to Trusted Locations bypasses security prompts for safe files.

By designating a specific folder as a Trusted Location, any macro-enabled file placed inside it will automatically run its Workbook_Open event without requiring you to manually click 'Enable Content' every time.

1
Access Excel Options

Open Microsoft Excel, click on 'File' in the top-left corner, and select 'Options' at the bottom of the sidebar.

2
Navigate to the Trust Center

In the Excel Options window, select 'Trust Center' from the left pane, then click the 'Trust Center Settings...' button.

3
Add a New Trusted Location

Select 'Trusted Locations' from the left menu and click on the 'Add new location...' button at the bottom.

4
Browse and Confirm

Click 'Browse' to locate the folder containing your .xlsm file. Check the box for 'Subfolders of this location are also trusted' if necessary, then click 'OK' on all windows to apply the changes.

Add the File Folder to Trusted Locations
Security Tip: Never add your 'Downloads' folder to Trusted Locations, as it frequently receives unverified files from the internet.
Advanced Spreadsheet Macro Support

Run Excel Macros Seamlessly with WPS Office

WPS Spreadsheet offers robust compatibility with Microsoft Excel VBA macros. You can easily manage macro security settings, designate trusted environments, and run your Workbook_Open scripts smoothly in a lightweight, high-performance workspace.

  1. 1. Open File in WPS Spreadsheet: Launch WPS Office and open your macro-enabled .xlsm workbook.
  2. 2. Access Developer Tools: Navigate to the 'Developer' tab located in the top ribbon menu.
  3. 3. Adjust Macro Security: Click on 'Macro Security' and set your preference to 'Medium' (prompts you before running macros) or 'Low' (for strictly trusted local files).
  4. 4. Reopen and Run: Save your settings, close the file, and reopen it. WPS Spreadsheet will now properly trigger the Workbook_Open event.
Fully compatible with Microsoft Excel .xlsm and .xlsb formatsIntegrated VBA editor for managing Workbook_Open eventsIntuitive Macro Security settings to safely handle automated scriptsFree and lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Workbook_Open macro run manually but not automatically?

This happens when the code is placed in a standard Module (like Module1) instead of the 'ThisWorkbook' object. The Workbook_Open event is explicitly tied to the workbook object and will only trigger automatically when placed in the ThisWorkbook module.

Is it safe to add my Downloads folder to Trusted Locations?

No, it is highly discouraged. The Downloads folder frequently receives files from the internet. If you add it to Trusted Locations, malicious macros in downloaded files could execute automatically. Only add specific, secure folders where you manually save verified files.

What happens if I save a macro in a standard .xlsx file?

Excel will not save the macro code. Standard .xlsx files do not support VBA code. Macros must be saved in macro-enabled formats such as .xlsm or .xlsb. If saved as .xlsx, the Workbook_Open event and all other macros will be permanently deleted upon closing.

Does WPS Office support Workbook_Open VBA macros?

Yes, WPS Office (specifically the Spreadsheet application) supports VBA macros, including workbook and worksheet events like Workbook_Open, providing high compatibility with existing Microsoft Excel macro files.