Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Close Excel with a Macro
Sometimes the help files are useful, and sometimes not! In this case
they are not. I want to shut down not only the spreadsheet but also the Excel application with a macro. Its one of those things that should be simple, but somehow I get tangled up with it, since shutting the spreadsheet down also shuts down the macros, which means that Excel doesn't get closed! Suggestions for code would be appreciated by this neophyte! Regards John Baker |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Close Excel with a Macro
Look at
Application.Quit in VBA's help. But this has never seemed like a very good idea to me. If I have multiple workbooks open and you quit excel, will you close those workbooks? How will you (the author of the code) know if I wanted to save a file, saveas a new name or just close without saving? You could have many users ticked off when they run your code. ====== On the other hand, if you're controlling your own instance of excel (from a different application), and you keep that instance hidden, it seems very reasonable. JHB wrote: Sometimes the help files are useful, and sometimes not! In this case they are not. I want to shut down not only the spreadsheet but also the Excel application with a macro. Its one of those things that should be simple, but somehow I get tangled up with it, since shutting the spreadsheet down also shuts down the macros, which means that Excel doesn't get closed! Suggestions for code would be appreciated by this neophyte! Regards John Baker -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Close Excel with a Macro
On Aug 7, 7:48*am, Dave Peterson wrote:
Look at Application.Quit in VBA's help. But this has never seemed like a very good idea to me. * If I have multiple workbooks open and you quit excel, will you close those workbooks? How will you (the author of the code) know if I wanted to save a file, saveas a new name or just close without saving? You could have many users ticked off when they run your code. ====== On the other hand, if you're controlling your own instance of excel (from a different application), and you keep that instance hidden, it seems very reasonable. JHB wrote: Sometimes the help files are useful, and sometimes not! In this case they are not. I want to shut down not only the spreadsheet but also the Excel application with a macro. Its one of those things that should be simple, but somehow I get tangled up with it, since shutting the spreadsheet down also shuts down the macros, which means that Excel doesn't get closed! Suggestions for code would be appreciated by this neophyte! Regards John Baker -- Dave Peterson Thanks..just needed a pointer. In fact this is an instance of Excel that IS opened by an Access application, and I want to get it out of the way after it executes. John Baker |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to close Excel 2007 | Excel Discussion (Misc queries) | |||
How to close a excel file using Macro coding? | Excel Discussion (Misc queries) | |||
Excel macro to close powerpoint | Excel Discussion (Misc queries) | |||
Macro to close excel | Excel Discussion (Misc queries) | |||
macro to close excel | Excel Discussion (Misc queries) |