Stop Excel Asking to Save Hidden Read-Only Workbook on Close
Question details
The user wants to prevent Excel from repeatedly prompting to save a hidden, read-only macro toolbox workbook every time the application is closed.
- Product
- Microsoft Excel 2019
- Device & OS
- Windows 11
- Scenario
- Closing the Excel application while a hidden, read-only workbook containing macros is open in the background.
- Observed behavior
- Following a Windows 11 update, Excel unexpectedly prompts the user to save the hidden, read-only workbook upon exiting.
Ensure you have the Developer tab enabled in Excel to access and edit VBA modules, and create a backup of your toolbox workbook before making script modifications.
Use an Auto_Close VBA Macro to Suppress the Save Prompt
By adding a specific Auto_Close macro to the workbook, you can instruct Excel to treat the file as already saved, bypassing the prompt when the application closes.
This VBA script forcibly sets the workbook's 'Saved' property to True right before the file closes. This effectively tricks Excel into believing no changes have been made, even if volatile functions or macros were triggered.
Unhide your toolbox workbook if necessary, make it the active window, and press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor.
In the Project Explorer pane on the left, right-click on your specific toolbox workbook name. Select 'Insert' from the context menu, then choose 'Module'.
In the newly opened code window, paste the following VBA script exactly: Sub Auto_Close() ThisWorkbook.Saved = True End Sub
Save the workbook and exit the VBA Editor. Close Excel to verify that the application now exits without prompting you to save this specific read-only workbook.
Verify AutoSave and Cloud Settings
Recent Windows updates may unexpectedly enable Microsoft 365 AutoSave features in standalone versions like Excel 2019, which can conflict with read-only files.
Switch to WPS Office for a Stable, Glitch-Free Macro Experience
If recent Windows 11 updates are causing Microsoft Excel to display unexpected save prompts or alter your UI settings, consider migrating to WPS Office. It provides a lightweight, highly compatible environment for running your custom VBA toolboxes without unexpected update glitches.
- 1. Download and Install: Download WPS Office for free from the official website and follow the simple installation wizard.
- 2. Open Your Macro Workbooks: Open your existing .xlsm or read-only toolbox workbooks directly in WPS Spreadsheets without needing to convert them.
- 3. Enable Macros and Work Seamlessly: Enable macro execution in WPS Spreadsheets and enjoy full functionality without the unwarranted save prompts caused by Office updates.

Frequently Asked Questions
Why does Excel ask to save a read-only file?
Excel may prompt you to save a read-only file if the workbook contains volatile functions (like TODAY or RAND) that recalculate upon opening, if background macros modify the sheet, or if recent application updates alter default AutoSave behaviors.
Will the Auto_Close macro affect my other open workbooks?
No. The command 'ThisWorkbook.Saved = True' specifically targets the single workbook where the VBA module is stored. Any other open Excel workbooks will still prompt you to save if there are unsaved changes.
How do I hide a workbook in Excel?
To hide an active workbook, navigate to the 'View' tab on the Excel ribbon and click 'Hide' in the Window group. This keeps the workbook open in the background (ideal for macro toolboxes) without cluttering your workspace.




