How to run an .exe app from within a function
-
Hi I was wondering how I would be able to run an .exe file from within a function. Thanks Nitin
-
Hi I was wondering how I would be able to run an .exe file from within a function. Thanks Nitin
You can use the Shell function : l_vRetVal = Shell(_your_exe_path_and_name", vbNormalFocus) This will asynchronously run the given .exe file. Have a look in the MSDN to understand the meaning of vbNormalFocus and to know the other possibilites. If you don't want to run it asynchronously (ie : you want the your function waits until the exe is finished), you'll have to create a process. If you need, I can give you more infos on that. Jerome
-
You can use the Shell function : l_vRetVal = Shell(_your_exe_path_and_name", vbNormalFocus) This will asynchronously run the given .exe file. Have a look in the MSDN to understand the meaning of vbNormalFocus and to know the other possibilites. If you don't want to run it asynchronously (ie : you want the your function waits until the exe is finished), you'll have to create a process. If you need, I can give you more infos on that. Jerome
An even simpler (and apparently more thread-safe for some reason that someone once told me that I can't remember!) is to use ShellExecute function - use the API viewer to get the VB prototype "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox