Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Randy Wayne
 
Posts: n/a
Default Is there a command line "switch" To close Excel

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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   Report Post  
Randy Wayne
 
Posts: n/a
Default

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
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
File close excel does not ask me to save changes Cathy Humphreys Excel Discussion (Misc queries) 2 June 13th 05 09:48 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 03:01 PM
macro to close excel Pam C Excel Discussion (Misc queries) 1 May 5th 05 05:43 PM
Excel Caused Error in VBE6.dll. Excel will Close mikeF New Users to Excel 0 March 3rd 05 03:01 PM
Why does spelling check close Excel when checking spanish? RCP Excel Discussion (Misc queries) 2 December 4th 04 08:37 PM


All times are GMT +1. The time now is 07:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"