Close file

  • Thread starter Thread starter mb
  • Start date Start date
M

mb

How do I close a file without saving the changes? I am using
ActiveWorkbook.close - is there a parameter I can add onto the end of this
statement?

MB
 
You can either set

application.displayalerts to false

or there is the specific setting of

ActiveWorkbook.saved = true which, if set without having actually saved
the file, causes Excel to quit without prompting...

Hope these help

David
 
Sub CloseMe()
ActiveWorkbook.Close SaveChanges:=False
End Sub

The 'False' bit tells it not to save before closing
 

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