Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Closing DOS window after shell command

I have a macro that runs the shell command to run a DOS
batchfile. At the end of the batchfile, the DOS window
will not close, even though the last line of the file is
EXIT. If I run the batchfile from a DOS window to begin
with, then the DOS window closes.

I am running Excel 2000 under Windows 98.

How can I close the DOS window from the macro?

TIA
Garry
  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Closing DOS window after shell command

Hi Garry,
RetVal = Shell(Environ$("comspec") & " /c yourfile.bat",vbNormalFocus)

The /c will kill the window. Use /k to keep it open.


--
John
johnf 202 at hotmail dot com


"Garry Boswell" wrote in message
...
| I have a macro that runs the shell command to run a DOS
| batchfile. At the end of the batchfile, the DOS window
| will not close, even though the last line of the file is
| EXIT. If I run the batchfile from a DOS window to begin
| with, then the DOS window closes.
|
| I am running Excel 2000 under Windows 98.
|
| How can I close the DOS window from the macro?
|
| TIA
| Garry


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
WindowStyle not working in shell command KLC Excel Programming 1 November 10th 03 10:10 PM
Application Process-Shell Command GarethG[_10_] Excel Programming 2 October 29th 03 01:35 PM
Parsing Shell Command with Parenthesis GarethG[_9_] Excel Programming 1 October 24th 03 05:53 PM
SHELL command Robin Clay[_3_] Excel Programming 3 October 17th 03 02:50 PM
How can you wait for the SHELL command to terminate ? Dave Peterson[_3_] Excel Programming 1 October 1st 03 09:10 AM


All times are GMT +1. The time now is 06:01 PM.

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

About Us

"It's about Microsoft Excel"