Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quit Excel without getting option to save 8

Status
Not open for further replies.

OzzieOwl

Technical User
Dec 13, 2001
45
GB
I need to be able to use the Application.Quit command to exit an excel document but I don't want the option to save if any changes have been made, does anyone know how to disable this option through VBA ?

Cheers

Martin

[upsidedown]
 
Set the saved property to true

application.displayalerts = false
saved = true
application.quit

should do the trick Rgds
~Geoff~
 
An alternative to above reply could be this ......

ActiveWorkbook.Close SaveChanges:=False
Application.Quit


Hope this helps.
 
another option

Workbooks(1).Close (Excel.XlSaveAction.xlDoNotSaveChanges)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top