VBA & Macro Problems

Fix a VBA Project That Remains Visible After Closing an Excel Workbook

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

Find out why a macro-enabled workbook's VBA project remains visible after the workbook is closed.

Fix a VBA Project That Remains Visible After Closing an Excel Workbook
Product
Microsoft Excel for Microsoft 365
Device & OS
not provided
Scenario
A user closes a macro-enabled workbook and checks Project Explorer in the Visual Basic Editor.
Observed behavior
The workbook's VBA project remains visible in Project Explorer after the workbook is closed.
Before you start

Note the project name and the workbook's expected file path. Check whether the project belongs to a regular workbook, an add-in, or the Personal Macro Workbook before closing or resetting anything.

Solution 1Recommended

Check the VBA project's workbook path and open workbooks

Use the Immediate window and Excel's window controls to identify the file associated with the visible project.

1
Select a module

In Excel, open Developer > Visual Basic. In Project Explorer, open a standard module under the project that remains visible.

2
Query the file path

Open View > Immediate Window, type ?ThisWorkbook.FullName, and press Enter. Record the returned path or any error; make sure the module from the relevant project is active.

3
Check for hidden workbooks

Return to Excel and select View > Unhide. If the workbook appears in the list, select it and click OK, then close it using File > Close.

4
Check other Excel windows

Switch through your open Excel windows and check whether another window has the same file or another copy open. Close the relevant workbook in that window if appropriate.

5
Repeat the path check

If Excel permits it, rename or move the closed file in your file manager, then run ?ThisWorkbook.FullName again in the project's Immediate window. Compare the result or error with the original path, and restore the file name or location afterward.

Check the VBA project's workbook path and open workbooks
Interpret the result carefully: A returned path identifies the workbook associated with the active project, but it does not by itself explain why the project remains visible. A workbook in another Excel instance does not normally appear in the current instance's Project Explorer.
Free Microsoft Office alternative

Work with spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for everyday spreadsheet work. Open compatible Excel files and migrate routine editing tasks with minimal adjustment. It does not fix a VBA project remaining visible in Microsoft's Visual Basic Editor.

Open and edit common Excel formats, including XLSX and XLSUse a familiar spreadsheet interface for everyday workbook tasksWork with a free, lightweight office suiteMove routine spreadsheet editing from Microsoft Office with minimal adjustment
microsoft office alternative - wps office

Frequently Asked Questions

How can I tell which file a visible VBA project belongs to?

Open a module in that project, select View > Immediate Window, and run ?ThisWorkbook.FullName. The result gives the associated workbook path, or an error if the expression cannot be evaluated.

Could the workbook still be open but hidden?

Yes. In Excel, select View > Unhide and check the list. If the workbook is listed, unhide it and use File > Close.

What does Reset do in the Visual Basic Editor?

Run > Reset stops running VBA code and clears project variables. You may need to restart macros or forms afterward.

Why does a project stay visible if it belongs to an add-in?

An enabled Excel add-in can remain loaded even when its workbook window is not visible. Check File > Options > Add-ins and review the relevant Manage list before changing its status.