Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Close and Exit Excel

Jeff wrote:
I don't know if there is a statement in VBA to close and
exit Excel. I am able to close my workbook using
the 'close' statement, but I leaves excel running. I
would like a complete exit of excel and have the machine
return to the desktop


Application.Quit?

cheers,
Stephan.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Close and Exit Excel

Jeff wrote:
Application.quit closes the file but leaves excel running,
as well as the VB editor, although the editor may be
incidental, due to my use of the editor.


Hmm, I just tried it and Application.Quit closes all workbooks *and*
terminates Excel on my machine. The help documents gives the following
sample which should save all workbooks and close Excel afterwards. And
that's excactly what the fragment does (on my machine).

For Each w In Application.Workbooks
w.Save
Next w
Application.Quit
Sorry, I guess that doesn't really help you.


cheers,
Stephan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Close and Exit Excel


-----Original Message-----
Jeff wrote:
Application.quit closes the file but leaves excel

running,
as well as the VB editor, although the editor may be
incidental, due to my use of the editor.


Hmm, I just tried it and Application.Quit closes all

workbooks *and*
terminates Excel on my machine. The help documents gives

the following
sample which should save all workbooks and close Excel

afterwards. And
that's excactly what the fragment does (on my machine).

For Each w In Application.Workbooks
w.Save
Next w
Application.Quit
Sorry, I guess that doesn't really help you.


cheers,
Stephan


.
Thanks for the Help.

I will investigate my machine(s). Have three and only
tried it on the oldest. Thanks again for the help, and
ignore the next post from me!

Good Hunting
Jeff
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Close and Exit Excel

In Excel VBA working in the current instance of Excel,

Application.Quit

will close all workbooks and close Excel.

If you are calling it from using Excel as an automation server, then if
there is an existing reference to Excel that hasn't been released, excel
will continue to be visible in the task manager.

In the first case, there may be things that could cause Excel not to close,
but the normal behavior is for Excel to close.

--
Regards,
Tom Ogilvy

"Jeff" wrote in message
...

-----Original Message-----
Jeff wrote:
I don't know if there is a statement in VBA to close

and
exit Excel. I am able to close my workbook using
the 'close' statement, but I leaves excel running. I
would like a complete exit of excel and have the

machine
return to the desktop


Application.Quit?

cheers,
Stephan.


.

Application.quit closes the file but leaves excel running,
as well as the VB editor, although the editor may be
incidental, due to my use of the editor.



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
How do I close all workbooks and exit excel with one click? Glen@DFR Excel Discussion (Misc queries) 5 July 10th 08 03:46 PM
Close vs. Exit in 2007 JBneedshelp Excel Discussion (Misc queries) 1 July 7th 08 09:16 PM
why do all excel worksheets/workbooks close when I close one? Penny Excel Discussion (Misc queries) 1 November 29th 06 03:49 AM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM


All times are GMT +1. The time now is 04:55 AM.

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"