Auto Close

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
 
R

Ron de Bruin

Hi buckle

ThisWorkbook.Close False ' save and close the file

ThisWorkbook.Close True ' close the file without saving

Application.Quit ' close Excel
 
B

buckle

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
 
B

buckle

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
 

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

Top