Originally Posted by
ggs22
I really don't see what could be wrong?
Nothing is going wrong. This is just a consequence of working in the Immediate Window. When you issue the command "?Application.DisplayAlerts" it toggles to True, but reverts back once you resume your code unless you explicitly set it in the Immediate Window. I believe this is necessary so that you are notified of errors that occur in the Immediate Window.
Give this try:
Select "Application.DisplayAlerts" and right-click on it and select "Add Watch". Now step through the code by pressing the F8 key and observe the watch window.
Edit:
If you want to Close the WorkBook without saving:
No need to worry about prompts to save and the BeforeClose event handler still runs.
Bookmarks