Is there a command line "switch" To close Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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/mi...subject:prompt"&rnum=1&hl=en#ccbc463e2166e781

(one line in your browser)

or
http://snipurl.com/h4wg
 
Dave:

thank you. Yes, being able to save is an issue. I will follow the thread
that you sent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top