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

Full Path Names in Word

An easy way to display the document's full path name in the title bar.

Discover More

Resetting Spelling and Grammar Checking on Multiple Documents

Things that are accomplished easily with a single document (such as resetting spelling and grammar checking settings) can ...

Discover More

Transposing Two Paragraphs

Need to swap two adjacent paragraphs? Your editing arsenal can include a command to do this if you use the macro in this tip.

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Making Changes in a Group of Workbooks

If you need to change the same data in a large number of workbooks, the task can be daunting. Here are some ideas (and ...

Discover More

Using a Single Password for Multiple Workbooks

While password protecting a workbook does provide some security for the contents in the workbook, if you have several ...

Discover More

Workbook Loses All Conditional Formatting

Workbooks created in very old versions of Excel can, at times, have issues when opened in later versions of the program. ...

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 four less than 7?

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.