View Full Version : [SOLVED:] Stop the "Do you want to save changes" prompt
groston
11-13-2025, 10:53 AM
I wrote a macro and this macro creates a new WorkBook. The last few lines in the macro are Erase lines and just before those lines, I have
MyNewWorkbook.Saved = True
However, when I click the x button in the workbook (top right corner), I get the "Do you want to save changes" prompt. Did I miss something?
June7
11-13-2025, 08:57 PM
Try just:
MyNewWorkbook.Save
But if this is a new workbook, probably need SaveAs to designate destination.
groston
11-13-2025, 09:32 PM
The line of code I showed is the line after the MyNewWorkbook.Save line. It was a failed attempt at addressing the issue.
Jan Karel Pieterse
11-18-2025, 08:25 AM
Make sure the MyNewWorkbook.Saved = True is the last line of the routine. But, if your file contains any volatile functions like TODAY, NOW or INDIRECT, there is nothing you can do to prevent this message.
groston
11-18-2025, 12:23 PM
Gotcha. Currently, there are some erase lines after that.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.