Closing an Excel Spreadsheet via command button

  • Thread starter Thread starter bartlwf
  • Start date Start date
B

bartlwf

Currently running Excel 2003
I have an excel program that I created for my wife's business that I
want to exit via an "exit button" without having any more user
interface. I can't seem to get past the standard excel message "Do
you want to save this file? ........Yes....No.......Cancel"
I just want to exit, no questions asked leaving the program intact.
Any Ideas?

Also, does anyone know of a website or place I can go to view excel
programs that demonstrate vba programs using the different uses of
UserForms and command buttons?

Thanks for any help you can shed on this.
 
This will work without saving workbook
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

This will work with saving workbook
Application.DisplayAlerts = False
ActiveWorkbook.save
ActiveWorkbook.Close
Application.DisplayAlerts = True
 
Back
Top