View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Renaud[_2_] Bill Renaud[_2_] is offline
external usenet poster
 
Posts: 117
Default External function call

Does the DOS app remain running after executing the Shell statement, or does
the batch file terminate automatically upon exit ("Close on exit" checkbox
is checked on the Programs tab in the Properties dialog box for the BAT
file).

You may not need the AppActivate statement. Also, try different values for
the second parameter in the Shell statement. 0 is vbHide, which will hide
the batch file window. In some of my tests, this would cause an error,
depending on what the batch file contained (I am running Windows ME and
Excel 2000, SP-3). If the batch file terminates and closes the window by
itself, then there is nothing for the AppActivate statement to do.

Try single stepping through this code and watch what happens.
--
Regards,
Bill


"Kevin" wrote in message
...
I'm haing a problem calling an external DOS app in certain
version of Windows. I've written a macro which calls
a .bat file. The relevant code is:

varPuttyUpload = Shell("c:\opt_mist1
\ssh\mist1_mist1upload.bat", 0)
AppActivate varPuttyUpload

It runs fine on a Win98 box but I run into problems on a
Win2000Pro or XP box. Changing the parameter from 0 to 1
has no effect.

Any suggestions?

thanks

kevin