View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] Nick.Korynski@gmail.com is offline
external usenet poster
 
Posts: 6
Default Launch a .bat file with VBA

Thanks for the reply. It's still not running correctly. I assume the
C:\x.bat in your example is the file location and filename? What does
the /c do? Thanks.

Gary''s Student wrote:
For example:

Sub belfry()
x = Shell("cmd.exe /c C:\x.bat", 1)
End Sub


CMD "understands" what to do with .bat files
--
Gary's Student


" wrote:

Is there a way to launch a .bat file in VBA? I have read to use the
shell command to launch programs, but that doesn't seem to be working
so I'm not sure that it works for anything other than executables? Is
there any way to do this? Thanks much!

Nick