Fix Excel Workbook Reference Error When Opening VBA Add-Ins
Question details
The user wants to resolve an error preventing a workbook from closing because it is being referenced by another workbook via shared VBA procedures.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Opening and managing multiple VBA add-ins that reference shared procedures.
- Observed behavior
- Excel displays a warning message that a workbook is referenced by another workbook and cannot be closed.
Before troubleshooting, ensure all unsaved work in your current Excel workbooks is saved, and temporarily disable any non-essential Excel add-ins to isolate the issue.
Report the Known VBA Issue to Microsoft Support
Since this is often a known issue with shared procedures in Excel VBA add-ins, submitting detailed feedback is the recommended Microsoft route.
This specific workbook reference locking is frequently tied to how Microsoft Excel handles memory allocation for multiple VBA add-ins sharing procedures. Reporting it directly helps prioritize a developer patch.
Open Microsoft Excel, navigate to the 'File' tab in the top-left corner, and select 'Feedback' from the left-hand menu.
Click on 'I Do Not Like Something' to open the feedback form. Detail the issue, specifically mentioning that multiple VBA add-ins referencing shared procedures cause the workbook reference error.
For immediate code-level workarounds, visit the Microsoft Q&A community and post your VBA structure specifics under the 'Office Excel IT Pro' or 'Office VBA Development' sections.

Consolidate Shared Procedures into a Single Add-in
To prevent cross-reference locking, consolidate your shared VBA procedures into a single master add-in.
Try WPS Office for Seamless Spreadsheet and Macro Management
If you frequently encounter complex VBA reference errors or bugs in Excel, consider switching to WPS Office. WPS Spreadsheet provides a stable environment for your data management needs without the heavy resource footprint.
- 1. Download and Install WPS Office: Visit the official WPS website to download and install the free, lightweight WPS Office suite.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet and open your existing .xlsx or .xlsm files seamlessly.
- 3. Manage Add-ins and Macros: Enable your macros in the WPS Spreadsheet environment to manage your automated tasks without encountering complex Excel-specific locking errors.

Frequently Asked Questions
Why does Excel say a workbook cannot be closed because it is referenced?
This typically happens when you have multiple VBA add-ins loaded that cross-reference each other's procedures. Excel locks the referenced workbook in memory to prevent code execution failure, stopping it from closing until the referring add-in releases it.
How do I safely remove a VBA add-in causing reference errors?
Go to File > Options > Add-ins. At the bottom of the window, select 'Excel Add-ins' from the Manage dropdown and click Go. Uncheck the suspected add-in, click OK, and restart Excel to fully clear the memory reference.
Can I use VBA macros in WPS Office?
Yes, WPS Office supports VBA macros. You can open your macro-enabled workbooks (.xlsm) and run your existing VBA scripts directly in the WPS Spreadsheet environment.




