ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to close excel (https://www.excelbanter.com/excel-discussion-misc-queries/35959-macro-close-excel.html)

okanem

Macro to close excel
 

I have been using the

ActiveWorkbook.save
ActiveWorkbook.Close (False)

commands to first ensure the spreadsheet saves and then closes. The
problem I am having is that this leaves Excel open. With 8
spreadsheets running daily each using this .Close command, I end up
with an awful lot of open excel windows.

I use Scheduler in conjunction with the Auto_Open macro to activate the
spreadsheets to run automatically. I have tried to use the 'Stop the
task if it runs for - 59 minutes' setting but this doesn't get rid of
Excel off the screen either but appears to just generate a Dr Watson.

Has anyone got the command to close excel completly from within the
macro.

Thanks for reading, and helping
Rgds
Okanem


--
okanem
------------------------------------------------------------------------
okanem's Profile: http://www.excelforum.com/member.php...fo&userid=9301
View this thread: http://www.excelforum.com/showthread...hreadid=388260


Bob Phillips

Application.Quit

--
HTH

Bob Phillips

"okanem" wrote in
message ...

I have been using the

ActiveWorkbook.save
ActiveWorkbook.Close (False)

commands to first ensure the spreadsheet saves and then closes. The
problem I am having is that this leaves Excel open. With 8
spreadsheets running daily each using this .Close command, I end up
with an awful lot of open excel windows.

I use Scheduler in conjunction with the Auto_Open macro to activate the
spreadsheets to run automatically. I have tried to use the 'Stop the
task if it runs for - 59 minutes' setting but this doesn't get rid of
Excel off the screen either but appears to just generate a Dr Watson.

Has anyone got the command to close excel completly from within the
macro.

Thanks for reading, and helping
Rgds
Okanem


--
okanem
------------------------------------------------------------------------
okanem's Profile:

http://www.excelforum.com/member.php...fo&userid=9301
View this thread: http://www.excelforum.com/showthread...hreadid=388260





All times are GMT +1. The time now is 01:32 PM.

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