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

Hi,

I have an excel workbook with macros that calls macros in other workbooks,
and all this works well.

It executes the code, and closes the other workbooks fine, but I can't
figure out how to close the "host" workbook and exit excel completely,
rather than leaving an excel shell open.

Any ideas appreciated.

Warm regards

Sunil Jayakumar


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Closing Excel

This will close the application in Excel 2000.
[you may want to save your workbook first]
[or you can set the workbook
ThisWorkbook.Save = True
this is supposed to make Excel think the workbook is already saved]

Application.Quit


--
steveB

Remove "AYN" from email to respond
"Sunil Jayakumar" <sunil.jayakumar[at]gmail.com wrote in message
...
Hi,

I have an excel workbook with macros that calls macros in other workbooks,
and all this works well.

It executes the code, and closes the other workbooks fine, but I can't
figure out how to close the "host" workbook and exit excel completely,
rather than leaving an excel shell open.

Any ideas appreciated.

Warm regards

Sunil Jayakumar



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Closing Excel

"Sunil Jayakumar" <sunil.jayakumar[at]gmail.com wrote in message
...
I have an excel workbook with macros that calls macros in other workbooks,
and all this works well.

It executes the code, and closes the other workbooks fine, but I can't
figure out how to close the "host" workbook and exit excel completely,
rather than leaving an excel shell open.


Hi Sunil,

Application.Quit will close Excel and any workbooks that are open in it.
This must be the last line of code in your workbook. All VBA code in a
workbook stops running when that workbook is closed, so if you close the
workbook before trying to close Excel, it won't work. If you want to avoid
the prompt to save your workbook that Excel may display on closing, add the
line ThisWorkbook.Saved = True just before the Application.Quit line.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
Excel closing down Gloria Excel Discussion (Misc queries) 0 March 2nd 09 05:37 PM
Closing Excel from a DLL CraigB Excel Programming 5 January 19th 05 06:17 PM
Closing VB triggers closing Excel Minilek Excel Programming 2 August 6th 04 05:17 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM


All times are GMT +1. The time now is 11:57 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"