Needing to Save a Workbook Twice

Written by Allen Wyatt (last updated April 29, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


1

Greg has several Excel workbooks that he uses on a regular or daily basis. But one is acting strange. The file consists of 14 worksheets. When he presses the Save button (either on the Quick Access Toolbar or File/Save) it shows the hourglass for a brief second. Then Greg immediately presses the Close button (top right "X" or File/Close) and Excel asks if he wants to save the file. This is the only workbook that does this; all of Greg's other workbooks close without asking him to save a second time. He wonders why this one file would be doing this.

Internally, Excel maintains what is known, at least colloquially, as a "dirty flag." In most simple terms, this is a True/False indicator as to whether something in the workbook has changed since the last time the workbook was saved. If something changes, then the flag is set to True. When you choose to close the workbook, Excel checks this flag and, if it is True, it asks you if you want to save your changes before closing.

So, in the case of Greg's workbook, the first culprit to suspect is something that is setting this dirty flag, making Excel think that something has changed in the workbook. This could be a macro that is changing something. For instance, there might be an event handler in the workbook that is run every time a different cell is selected. Or, perhaps there is a Workbook_BeforeClose event handler in place. Either way, the event handler may trigger within Excel the idea that something has changed within the workbook.

The only way to figure out if it is a macro is to do some detective work and examine the macros that may be saved in the workbook. Of course, this all assumes that the workbook is saved as macro-enabled, with the XLSM filename extension. If this is how the workbook is saved, then an easier way to figure out if a macro is involved is to follow these general steps:

  1. Open the workbook that is requiring multiple saves.
  2. Using, Save As, save the workbook in a non-macro-enabled (XLSX) format.
  3. Restart Excel and open the workbook you just saved.
  4. Go through your normal exit routine (save, then click on close) and see if the second save is still necessary.

Of course, if there are macros causing the issue, then it is possible those macros are necessary for proper functioning of the workbook in the first place. Further testing with the workbooks (both XLSM and XLSX formats) will be necessary to make that determination.

There are other things besides macros that could be causing Excel to think the workbook should be saved again. This has to do with what Excel terms "volatile functions," which are functions that, during recalculation, are automatically updated. This would set the dirty flag, and thereby make Excel think your workbook has to be saved again. You can learn about volatile functions at this Microsoft page:

https://learn.microsoft.com/en-us/office/client-developer/excel/excel-recalculation#volatile-and-non-volatile-functions

Of course, the entire irritation could be avoided if Greg simply changes his exiting routine—skip the step of saving and just close the workbook. If anything has changed in the workbook, Excel asks you if you want to save, and you can save at that point. In this approach you are relying on Excel to keep track of when saving is necessary and when it is not, which (as you now know) is something that Excel is going to do in any case.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9765) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using Multiple References to the Same Footnote

Do you want to have multiple footnote references to the same actual footnote in a document? The easiest way to do this is ...

Discover More

Creating Individual Workbooks

Workbooks can contain many worksheets. If you want to pull a workbook apart and create a whole series of workbooks based ...

Discover More

Moving Text Using the Mouse

Many people use the keyboard to do their primary editing tasks. Word doesn't limit you to the keyboard, however. You can ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Workbooks Opening as Read-Only

If Excel thinks a workbook should not be changed, there is a good chance it will be opened as read-only. This tip looks ...

Discover More

Saving a Workbook in a Macro

Does your macro need to make sure that the workbook being processed is saved to disk? You can add the saving capability ...

Discover More

Making Ribbon Customizations Apply to All Workbooks

Excel allows you to easily make changes to the ribbon, as well as to the Quick Access Toolbar, which is near the ribbon. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 4 + 5?

2023-04-29 07:55:27

Alex Blakenburg

A circular reference will behave in a similar manner to a volatile function.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.