External function call

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top