Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default Shell Command Fails (sometimes)

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Shell Command Fails (sometimes)

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default Shell Command Fails (sometimes)

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default Shell Command Fails (sometimes)

Q1)When you say it doesn't work... what does that mean?
A1) The desired results does not happen, the exe is not executed

Q2) When it doesn't work, do you get any kind of indication that it didn't
work?
A2) yes, the dos screen flashes (open/close) however the exe is not
executed, no error message to work with, no error message in the output file
(when the exe runs it generates an out file), this means the exe did not kick
in, why, that is what I am trying to find out

and the problem is that this is intermittent, sometimes it works and
sometimes it does not,

sorry I am really disconcerted with this
any other ideas








"Rick Rothstein (MVP - VB)" wrote:

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




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
Wscript.Shell Run vbs Fails? RayportingMonkey Excel Programming 1 October 12th 07 06:33 PM
Shell Command JOHN Excel Programming 1 November 17th 04 10:39 AM
Shell command MAx Excel Programming 2 June 4th 04 04:11 PM
xp shell command using vba Sudhendra Excel Programming 2 February 16th 04 05:56 AM
SHELL command Robin Clay[_3_] Excel Programming 3 October 17th 03 02:50 PM


All times are GMT +1. The time now is 09:35 AM.

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"