View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default dos from excel vba?

Ps. You may want to post the version of Windows you're running. I'm not sure
if all versions behave the same.

Dave Peterson wrote:

It sounds like that it's not the DOS window that's giving you that message--it
sounds like it's the application that you're running that's doing the message.

You may be able to edit that vq80run.bat to get rid of that last prompt.

If you look and don't see anything, then maybe just adding:

EXIT

as the last line of the .bat file would be enough.

Jason wrote:

sorry if i am trying to be stupid Dave, the coding i used is

Dim RetVal
Dim OldPath As String
Dim NewPath As String
OldPath = CurDir
NewPath = "C:\VQ80_2\"
ChDrive NewPath
ChDir NewPath
b = NewPath & "VQ80RUN.bat" & " """ & TextBox1 & ".prn""" & " """ & TextBox1
& ".out"""
RetVal = Shell(b, vbMinimizedFocus)
Shell Environ("comspec") & " /c " & myCommand, vbMinimizedFocus

, the program executes and ends in the ms dos window,and promts "press any
key to continue", so the dos window closes if any key is pressed.

i did use ' Shell Environ("comspec") & " /c " & myCommand, vbMinimizedFocus,
but no effect..

"Dave Peterson" wrote:

From that earlier post:

Shell Environ("comspec") & " /k " & myCommand, vbMaximizedFocus


Change the /k to /c to dismiss that DOS window when it's done.


--

Dave Peterson


--

Dave Peterson