ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   app.quit (https://www.excelbanter.com/excel-programming/405870-app-quit.html)

Joanne

app.quit
 
When I am ready to close my ws, I have a button that clears all contents
so the sheet is a blank form ready for the next usage. The last command
on my 'Clear' button is Application.Quit. It always asks if I want to
save my changes. Is there a way to disable this so that it will just
quit when I click my command button?
Thanks for the info
Joanne

Rick Rothstein \(MVP - VB\)[_1262_]

app.quit
 
The last sentence of the help files for Quit says this...

"If you set the Saved property for a workbook to True without
saving the workbook to the disk, Microsoft Excel will quit
without asking you to save the workbook."

So, executing this...

ThisWorkbook.Saved = True

before your Application.Quit statement should do it for you.

Rick


"Joanne" wrote in message
...
When I am ready to close my ws, I have a button that clears all contents
so the sheet is a blank form ready for the next usage. The last command
on my 'Clear' button is Application.Quit. It always asks if I want to
save my changes. Is there a way to disable this so that it will just
quit when I click my command button?
Thanks for the info
Joanne



Joanne

app.quit
 
Thanks
MVP - VB\ wrote:

The last sentence of the help files for Quit says this...

"If you set the Saved property for a workbook to True without
saving the workbook to the disk, Microsoft Excel will quit
without asking you to save the workbook."

So, executing this...

ThisWorkbook.Saved = True

before your Application.Quit statement should do it for you.

Rick


"Joanne" wrote in message
...
When I am ready to close my ws, I have a button that clears all contents
so the sheet is a blank form ready for the next usage. The last command
on my 'Clear' button is Application.Quit. It always asks if I want to
save my changes. Is there a way to disable this so that it will just
quit when I click my command button?
Thanks for the info
Joanne





All times are GMT +1. The time now is 08:49 PM.

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