Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
Excel closing down | Excel Discussion (Misc queries) | |||
Closing Excel from a DLL | Excel Programming | |||
Closing VB triggers closing Excel | Excel Programming | |||
closing excel after closing a workbook | Excel Programming |