logo
search
VBA & Macro Problems

Fix Excel Add-In Reference Disappearing After Reopening Workbook

WPS Content ManagerWPS Content Manager Oct 9, 2026 873 views

Question details

The user needs to prevent custom Excel add-in references from disappearing every time a workbook is closed and reopened.

Fix Excel Add-In Reference Disappearing After Reopening a Workbook
Product
Excel
Device & OS
not provided
Scenario
Setting up VBA project references to custom Excel add-ins (XLAM) in a workbook.
Observed behavior
The established reference to a custom Excel add-in drops or disappears upon reopening the workbook unless a code module is added to the VBA project.
Before you start

Ensure you are saving your dependent workbook in a macro-enabled format (like .xlsm or .xlsb), as standard .xlsx workbooks will automatically drop any embedded VBA projects and references upon saving.

Solution 1Recommended

Add a Code Module and Save as a Macro-Enabled Workbook

To make a custom VBA reference persist, the dependent workbook must have an active code module inside the VBA editor and be saved correctly.

Excel is designed to drop VBA references in completely empty VBA projects or standard .xlsx files to prevent unnecessary overhead. By adding at least one module (even if you leave it completely empty) and saving the file as macro-enabled, the reference to your XLAM add-in will be permanently retained.

1
Open the Visual Basic Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor within your Excel application.

2
Insert a New Module

In the Project Explorer pane on the left side, right-click your target workbook's project, hover over 'Insert', and select 'Module'. You can leave this newly created module completely blank.

3
Establish the Add-In Reference

Go to the top menu bar, click 'Tools' > 'References', click the 'Browse' button, and navigate to select your custom .xlam add-in file. Click 'OK' to apply.

4
Save as XLSM Format

Close the VBA editor to return to your Excel workbook. Click 'File' > 'Save As', and ensure you choose 'Excel Macro-Enabled Workbook (*.xlsm)' from the format dropdown menu.

Add a Code Module and Save as a Macro-Enabled Workbook
Macro Security Settings: If the reference persists but the code does not run, check your macro security settings under 'File' > 'Options' > 'Trust Center' and ensure the add-in folder is added to your 'Trusted Locations'.
Manage Macros with WPS Office

Create and Manage Macro-Enabled Workbooks in WPS Spreadsheets

WPS Office provides highly compatible support for VBA macros and macro-enabled workbooks (.xlsm), offering a smooth environment for developing and managing your custom add-ins and scripts.

  1. 1. Enable Developer Tools: Open WPS Spreadsheets, navigate to the 'Options' menu, and ensure the Developer tab is enabled to access the necessary VBA ribbon features.
  2. 2. Insert a Module in WPS VBA Editor: Click on 'Developer' > 'Visual Basic', right-click your active project in the project explorer, and insert a new Module to keep your references active.
  3. 3. Save as XLSM: Click 'Menu' > 'Save As' and select 'WPS Spreadsheets Macro-Enabled Workbook (*.xlsm)' to securely retain your add-in references and VBA code.
Seamlessly open, edit, and save Microsoft Excel .xlsm and .xlam formats.Built-in Developer tools to manage VBA projects and module references easily.Lightweight architecture ensures your macro-heavy spreadsheets load incredibly fast.
QA img-9

Frequently Asked Questions

Why does my Excel Add-in disappear from the ribbon?

If your add-in is not saved in a trusted directory or if your macro security settings block it, Excel may automatically disable the add-in upon startup. You can fix this by adding the add-in's folder to Excel's Trusted Locations via the Trust Center.

Can I save VBA macros in a standard .xlsx file?

No, standard .xlsx files cannot store VBA projects, macros, or custom add-in references. You must save your document as a macro-enabled workbook (.xlsm) or a binary workbook (.xlsb) to retain these elements.

What is an XLAM file used for in Excel?

An XLAM file is a specific Excel Add-In format containing macros and custom VBA functions. It is designed to be loaded silently in the background so its functions and scripts are available across multiple workbooks without displaying visible worksheets.