How to Close One Excel VBA Project Without Closing Others
Question details
The user wants to close a single Excel VBA project or macro-enabled workbook, but attempting to do so closes all open VBA files or the entire application.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Managing multiple open macro-enabled workbooks and needing to close just one without losing active sessions in the others.
- Observed behavior
- Attempting to close one workbook results in all open VBA projects and workbooks closing simultaneously.
Save your progress in all open VBA projects and workbooks before troubleshooting to prevent data loss in case the application closes unexpectedly.
Use the File Menu Instead of the Window Close Button
Using the dedicated File menu ensures you are only commanding the active workbook to close, preventing accidental closure of the entire application.
Often, clicking the 'X' in the top-right corner of the Excel window can inadvertently close the entire Excel application rather than just the current workbook. This is especially true if multiple projects are running in the same instance.
Click anywhere inside the specific macro-enabled workbook you want to close to make it the active window.
Click on 'File' located in the top-left corner of the Excel ribbon.
Select 'Close' from the left-hand menu list. This will close only the active workbook while keeping other VBA projects open.

Open Excel in Safe Mode to Disable Interfering Add-ins
Identifies if a third-party add-in or external software is intercepting the close command and shutting down all files.
Manage Multiple VBA Projects Seamlessly with WPS Office
WPS Spreadsheet offers a robust, tabbed viewing interface that makes managing multiple macro-enabled workbooks simple. You can close individual tabs without ever risking the closure of your other active VBA projects.
- 1. Download and install WPS Office: Get the free version of WPS Office from the official website and install it on your device.
- 2. Open your macro-enabled workbooks: Launch WPS Spreadsheet and open your .xlsm or VBA-enabled files. They will neatly organize into individual tabs at the top.
- 3. Close tabs individually: Simply click the small 'X' on a specific document tab to close only that project, leaving all other VBA projects running safely.

Frequently Asked Questions
Why does holding the Shift key close all my open Excel workbooks?
Holding the Shift key while clicking the 'X' button in the top-right corner of the Excel window is a built-in Windows shortcut designed to close all open workbooks and the entire application simultaneously.
Can a faulty keyboard cause all my Excel files to close at once?
Yes. If your Shift key is physically stuck or malfunctioning, Excel may register a standard 'Close' click as a 'Shift+Close' command, automatically shutting down all active windows and VBA projects.
Do third-party add-ins affect how Excel VBA projects close?
Absolutely. Some poorly coded third-party add-ins or external macros can interfere with native Excel commands, causing a single workbook close action to terminate the entire application. Booting Excel in Safe Mode can help identify and bypass these add-ins.
Is there a keyboard shortcut to close just one workbook?
Yes, you can press Ctrl + W or Ctrl + F4 on your keyboard. These shortcuts are specifically designed to close the active workbook window without shutting down the entire Excel application.




