Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I am looking for a command line "switch" to exit Excel and/or a batch file
that can be run at a certain time that would look for an open instance of Excel and close it. -- Thanks, Randy |
#2
![]() |
|||
|
|||
![]()
You could create a .VBS file that looked like:
dim myXL On Error Resume Next Set myXL = GetObject(, "Excel.Application") If Err.Number = 429 Then msgbox "Excel is not running" else myxl.quit end If On Error GoTo 0 Set myxl = nothing But if you have a workbook that's been changed and not saved, excel will wait for you to answer the "do you want to save your changes prompt". And if excel isn't the active application, the excel icon on the taskbar will blink to get your attention. ====== If you just want to kill excel, you can read a few suggestions in this thread: http://groups.google.co.uk/group/mic...bc463e2166e781 (one line in your browser) or http://snipurl.com/h4wg Randy Wayne wrote: I am looking for a command line "switch" to exit Excel and/or a batch file that can be run at a certain time that would look for an open instance of Excel and close it. -- Thanks, Randy -- Dave Peterson |
#3
![]() |
|||
|
|||
![]()
Dave:
thank you. Yes, being able to save is an issue. I will follow the thread that you sent. -- Thanks, Randy "Dave Peterson" wrote: You could create a .VBS file that looked like: dim myXL On Error Resume Next Set myXL = GetObject(, "Excel.Application") If Err.Number = 429 Then msgbox "Excel is not running" else myxl.quit end If On Error GoTo 0 Set myxl = nothing But if you have a workbook that's been changed and not saved, excel will wait for you to answer the "do you want to save your changes prompt". And if excel isn't the active application, the excel icon on the taskbar will blink to get your attention. ====== If you just want to kill excel, you can read a few suggestions in this thread: http://groups.google.co.uk/group/mic...bc463e2166e781 (one line in your browser) or http://snipurl.com/h4wg Randy Wayne wrote: I am looking for a command line "switch" to exit Excel and/or a batch file that can be run at a certain time that would look for an open instance of Excel and close it. -- Thanks, Randy -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File close excel does not ask me to save changes | Excel Discussion (Misc queries) | |||
Excel Range Value issue (Excel 97 Vs Excel 2003) | Excel Discussion (Misc queries) | |||
macro to close excel | Excel Discussion (Misc queries) | |||
Excel Caused Error in VBE6.dll. Excel will Close | New Users to Excel | |||
Why does spelling check close Excel when checking spanish? | Excel Discussion (Misc queries) |