logo
search
VBA & Macro Problems

How to Fix Excel VBA Workbook_Open Macro Not Running Automatically

Camila MilosovichCamila Milosovich Sep 27, 2026 869 views

Question details

The user needs to resolve an issue where a VBA macro located in ThisWorkbook fails to trigger automatically when the Excel file is opened or copied.

How to Fix Excel VBA Workbook_Open Macro Not Running Automatically
Product
Excel
Device & OS
not provided
Scenario
Opening a macro-enabled Excel workbook and expecting the Workbook_Open event to execute automatically.
Observed behavior
The Workbook_Open macro does not execute automatically upon opening the file, which is commonly caused by macro security settings, disabled events, or incorrect VBA code placement.
Before you start

Ensure that your workbook is saved as an Excel Macro-Enabled Workbook (.xlsm) and that you trust the source of the file before altering any macro security settings.

Solution 1Recommended

Enable Macros and Adjust Trust Center Settings

The most common reason for an auto-run macro failing to execute is Excel's Trust Center blocking macros by default for security purposes.

By default, Excel disables macros to protect your computer from potentially malicious code. If you do not receive a prompt to enable macros when opening the file, your Trust Center settings may be strictly blocking them.

1
Open Trust Center Settings

Open your Excel workbook. Click on 'File' in the top-left corner, select 'Options' at the bottom, and then click on 'Trust Center'. Click the 'Trust Center Settings' button.

2
Adjust Macro Settings

Navigate to the 'Macro Settings' tab on the left. Select 'Disable all macros with notification' so Excel prompts you to enable them when opening the file.

3
Add a Trusted Location (Optional)

If you frequently use this workbook, go to 'Trusted Locations' in the Trust Center, click 'Add new location', and select the folder where your file is saved. Macros in Trusted Locations will run automatically without prompts.

Enable Macros and Adjust Trust Center Settings
Security Tip: Always use 'Disable all macros with notification' rather than 'Enable all macros' to maintain device security while still allowing your required scripts to run.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

If you frequently deal with complex Microsoft Office issues, consider switching to WPS Office. It provides excellent compatibility with Microsoft Excel formats, a familiar user interface, and is completely free and lightweight.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package.
  2. 2. Install the Application: Run the installer and follow the quick on-screen instructions to set up WPS Office on your device.
  3. 3. Open Your Spreadsheets: Double-click your existing .xlsx or .xlsm files to open them instantly in WPS Spreadsheet with full formatting preserved.
Highly compatible with Microsoft Excel formats (.xlsx, .xlsm, .xls)Familiar, easy-to-use interface with zero learning curveLightweight installation that runs smoothly on any deviceCompletely free alternative to Microsoft Office
QA img-9

Frequently Asked Questions

Why does my macro run perfectly when executed manually but not upon opening?

This usually happens if the macro is not placed inside the 'ThisWorkbook' module, or if the subroutine is not strictly named 'Private Sub Workbook_Open()'. Standard modules do not listen for workbook-level events.

Will saving my file as an .xlsx document remove my macros?

Yes, the standard .xlsx format is macro-free and cannot save VBA code. You must save your document as an Excel Macro-Enabled Workbook (.xlsm) or an Excel Binary Workbook (.xlsb) to retain your VBA scripts.

How do I re-enable events if my VBA macro accidentally turned them off?

If 'Application.EnableEvents = False' was executed and never turned back on, your automatic macros will stop triggering. To fix this, press Alt+F11 to open the VBA Editor, press Ctrl+G to open the Immediate Window, type 'Application.EnableEvents = True', and press Enter.