Auto Close

  • Thread starter Thread starter buckle
  • Start date Start date
B

buckle

I've been able to use the scheduler to start a worksheet and automatically
run a macro (thanks to Tom Ogilvy), however I still can't get the
spreadsheet and Excel to close and quit. What am I missing?

Thanks again
 
Hi buckle

ThisWorkbook.Close False ' save and close the file

ThisWorkbook.Close True ' close the file without saving

Application.Quit ' close Excel
 
Thanks Ron,

I inserted:

ThisWorkbook.Close False
Application.Quit

- in the macro and the workbook closes, but Excel stays open? Do I need
something more?

Thanks again
 
That's it! Thanks Ron.

Ron de Bruin said:
First Typo in the comments

ThisWorkbook.Close False ' close the file without saving

ThisWorkbook.Close True ' save and close the file


Use this to close the workbook without saving

ThisWorkbook.Saved = True
Application.Quit

And this if you want to save it first

ThisWorkbook.Save
Application.Quit
 
Back
Top