ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Closing an Excel Spreadsheet via command button (https://www.excelbanter.com/excel-programming/406204-closing-excel-spreadsheet-via-command-button.html)

[email protected]

Closing an Excel Spreadsheet via command button
 
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.

Mike

Closing an Excel Spreadsheet via command button
 
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

" wrote:

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.



All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com