app.quit

  • Thread starter Thread starter Joanne
  • Start date Start date
J

Joanne

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
 
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
 
Thanks said:
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
 

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