How to Fix Closed Workbooks Still Appearing in the Excel VBA Project Window
Question details
The user needs to remove closed Excel workbooks from the VBA Project window and prevent the Visual Basic Editor or Excel from crashing when expanding them.

- Product
- Microsoft Excel Visual Basic Editor
- Device & OS
- not provided
- Scenario
- After closing macro-enabled workbooks in Excel, the user opens the VBA Project window and sees closed workbook entries still listed; expanding them can crash the editor or Excel.
- Observed behavior
- Closed Excel workbooks remain visible in the VBA Project window, and expanding them can cause the Visual Basic Editor or Excel to crash.
Save any open macro-enabled workbooks, note the Excel version and update channel via File > Account > About Excel, and close the Visual Basic Editor and any unnecessary Excel sessions before troubleshooting.
Restart Excel, Reboot the PC, and Install the Latest Office Updates
Use this first because it clears the VBE project cache and addresses known Visual Basic Editor bugs that leave closed workbooks visible.
Ghost workbook entries are generally a known Visual Basic Editor bug. Restarting Excel removes the in-memory project handles, while Office updates deliver the latest fixes for the editor and macro components.
In Excel, close each workbook and the VBA editor window completely, or click File > Exit to quit Excel.
Reopen Excel and check the VBA Project window; if entries remain, select Start > Power > Restart to reboot the computer.
Open Excel, click File > Account > Update Options > Update Now, and restart Excel after the updates finish.
Press Alt+F11 and confirm that closed workbooks no longer appear before resuming work.

End Lingering Excel Processes in Task Manager
Use this if restarting Excel does not clear the entries, because hidden Excel subprocesses can keep closed workbook handles active in the VBA Project window.
Remove Lingering Object References and Set Objects to Nothing When Workbooks Close
Apply this after clearing the immediate issue to prevent closed workbooks from being retained by global objects, circular references, or unused object variables.
Use WPS Office Free as a Lightweight Alternative When Excel VBA Issues Disrupt Work
The ghost-workbook issue belongs to Microsoft Excel's Visual Basic Editor, and WPS Office does not patch that Microsoft bug. WPS Office is a free, lightweight, easy-to-use alternative that opens and saves Excel formats, offers a familiar ribbon UI, and makes migration from Excel straightforward.

Frequently Asked Questions
Why do closed workbooks still appear in the VBA Project window?
It is usually a known Visual Basic Editor bug. Lingering object references, circular references, public or global object variables, and active Excel processes can keep project handles visible after workbooks close.
How do I remove a closed workbook from the VBA Project window?
Close the VBA editor and all Excel windows, restart Excel or the computer, install Office updates via File > Account > Update Options > Update Now, and check Task Manager for lingering Excel.exe processes. Then reopen the editor with Alt+F11.
Can WPS Office fix the Excel VBA Project window bug?
WPS Office does not patch Microsoft Excel's Visual Basic Editor, but it is a free, lightweight alternative that can open and save Excel formats including macro-enabled workbooks.
Will setting objects to Nothing prevent closed workbooks from appearing?
Yes, in many cases. Release module-level or global object variables in the Workbook_BeforeClose event and avoid circular references between class modules to reduce lingering workbook projects.
Does ending Excel processes in Task Manager lose unsaved work?
Yes, ending Excel processes can close unsaved workbooks. Save or confirm that you can discard changes before ending Excel.exe in Task Manager.




