Fix Excel Workbook_Open Not Running When XLAM Add-In Is Open
Question details
The user needs to fix an issue where the Excel Workbook_Open VBA event fails to trigger if an XLAM add-in is already open in the background.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating tasks upon opening a workbook using the Workbook_Open event while concurrently running XLAM add-ins.
- Observed behavior
- The Workbook_Open VBA procedure does not execute when the XLAM file is opened first, but it runs normally when the XLAM file is closed or unloaded.
Ensure you have access to the Visual Basic for Applications (VBA) Editor by pressing ALT + F11, as you will need to check macro codes and system event settings.
Check and Re-enable Excel Application Events via VBA
Use the Immediate Window in the VBA Editor to verify if application events have been disabled by the XLAM add-in and manually turn them back on.
Often, an XLAM add-in might contain VBA code that sets 'Application.EnableEvents = False' to prevent recursive loops. If the add-in crashes or fails to set it back to 'True', all subsequent application triggers, including Workbook_Open, will stop functioning.
Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor in Excel.
Press CTRL + G to display the Immediate Window, usually located at the bottom of the VBA Editor screen.
Type '?Application.EnableEvents' in the Immediate Window and press Enter. If the system returns 'False', events are currently disabled.
Type 'Application.EnableEvents = True' in the Immediate Window and press Enter to restore default event triggers.
Close the VBA editor and re-open your target workbook to confirm that the Workbook_Open event executes correctly.

Isolate and Disable the Conflicting XLAM Add-in
Determine if a specific XLAM file is causing the interference by running Excel without it and reviewing its specific ThisWorkbook module.
Experience Seamless VBA & Macro Compatibility with WPS Office
If you frequently encounter complex Excel add-in conflicts or unresponsive Workbook_Open events, consider trying WPS Office. It provides a highly compatible spreadsheet environment that handles standard Office formats and advanced macro configurations reliably.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installation package.
- 2. Install the Software: Run the installer and follow the on-screen instructions to set up WPS Office on your computer.
- 3. Open Your Macro-Enabled Files: Launch WPS Spreadsheets and open your .xlsm or .xlam files to experience seamless macro performance.

Frequently Asked Questions
Why does the Workbook_Open event not trigger in Excel?
The most common reasons are that macros are disabled in your Excel Trust Center settings, or 'Application.EnableEvents' has been set to False by another macro or an XLAM add-in running in the background.
What exactly is an XLAM file?
An XLAM file is an Excel Macro-Enabled Add-in. It is used to distribute custom VBA functions, macros, and tools to Excel. These files usually run invisibly in the background when Excel is opened.
How can I ensure events are always enabled when Excel starts?
You can create a personal macro workbook (PERSONAL.XLSB) that includes a Workbook_Open script to forcefully execute 'Application.EnableEvents = True' every time you launch the Excel application.
Does WPS Office support XLAM add-ins and VBA macros?
Yes, specific versions of WPS Office include comprehensive VBA support, allowing you to run and edit macros, open .xlsm workbooks, and utilize XLAM add-ins with high compatibility to Microsoft Excel scripts.




