View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Shell Command Fails (sometimes)

When you say it doesn't work... what does that mean? When it doesn't work,
do you get any kind of indication that it didn't work? Do you get an error
(if so, what is the error message)? Does something happen, but not what you
expect? Does nothing happen?

Oh, I have to ask... you are use paths with your filenames, right?

Rick


"Daniel" wrote in message
...
Thx Rick, but it still does the same
any other ideas?



"Rick Rothstein (MVP - VB)" wrote:

Is it failing when the filename or its path contains blank spaces in
them?
Try this...

Shell Environ("comspec") & " /c """ & ProgramFile & _
""" <""" & InFile & _
""" """ & OutFile & """", vbNormalFocus

Rick


"Daniel" wrote in message
...
I have been using the shell command often this way:

Shell Environ("comspec") & " /c " & ProgramFile & " <" & InFile & " "
&
OutFile, vbNormalFocus

Sometimes it works and sometimes it does not (within the same
directory,
the
path is OK.) It does not seem to be reading the input file of the
executable.

any ideas?

Thanks
Dan