View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Alex[_8_] Alex[_8_] is offline
external usenet poster
 
Posts: 1
Default Running a batch file from VB

I've used the Shell() command in the past, and it is OK ... However, I
have found that using the 'Windows Script Host' is better, as you can
wait until the actual batch file has completed, before continuing.

You first need to add the 'Windows Script Host Object Model' to the
list of references, and then you need the following code:

Dim WSHShell As New IWshShell_Class

'ARA run the calculator, wait for it to be closed before
continuing.
Call WSHShell.Run("calc.exe", , True)


Have Fun,


Alex.