ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   External function call (https://www.excelbanter.com/excel-programming/294207-external-function-call.html)

Kevin

External function call
 
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

Bill Renaud[_2_]

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





All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com