Closing an Unsaved (but Changed) Workbook

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

How do I close a worksheet that I've changed (at the same
time that I close Excel), but don't want the changes to be
permanent? I tried using the following code:

ActiveWorkbook.Saved = True
Application.Quit

However, it doesn't work; it still asks me whether I want
to save the changes.
 
But once the workbook is closed, it won't reach the last
line and close Excel.
 
Switch the order

Application.Quit
ActiveWorkbook.Close SaveChanges:=False

Quits, but does not bring up save changes dialog
 
Thanks Bill!
-----Original Message-----
Switch the order

Application.Quit
ActiveWorkbook.Close SaveChanges:=False

Quits, but does not bring up save changes dialog

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top