#1   Report Post  
okanem
 
Posts: n/a
Default 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

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to close excel Pam C Excel Discussion (Misc queries) 1 May 5th 05 04:43 PM
excel macro to update visio orgchart Anna Excel Discussion (Misc queries) 0 April 29th 05 11:38 AM
How can I edit cell contents with a macro in Excel? Mind the gaps! Excel Discussion (Misc queries) 2 March 23rd 05 08:51 PM
Problem Editing Macro in Shared Excel File [email protected] Excel Discussion (Misc queries) 0 March 19th 05 06:01 PM
Macro not working with Excel 2003 Fernando Gomez Excel Discussion (Misc queries) 1 December 16th 04 12:19 AM


All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"