Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WindowStyle not working in shell command | Excel Programming | |||
Application Process-Shell Command | Excel Programming | |||
Parsing Shell Command with Parenthesis | Excel Programming | |||
SHELL command | Excel Programming | |||
How can you wait for the SHELL command to terminate ? | Excel Programming |