View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
external usenet poster
 
Posts: 21
Default Running a .bat file via AppActivate

I'm trying to run a .bat file from a macro. I can call
an .exe with no problem (using the same "shell" and
AppActivate" code). I can even call a .exe renamed as
a .bat. If I run it from a command line directly, or even
by double clicking on it, it runs fine. However I cannot
run the .bat from the shell/appactivate combo. Here's the
code I'm using:

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

Watching the locals windows stepping through the macro
shows a return value from the shell function of -610925
(which seems odd).

Changing the trigger from 0 to 1 has no effect. No matter
what I do, I get the following:

"Run-time error '5':
Invalide procedure call or arguement."

If I substitute say "calc.exe" it runs fine.

Any suggestions?

thanx

Kevin