How to start an application from Excel VBA

G

Guest

I would like to start an application from Excel VBA and pass command line
parameters to it. Once the app is started it should run completely
independently from the instance of Excel that started it.

Excel shouldn't wait on it to to anything (including terminate).

Thanks.
 
G

Guest

Thanks, I haven't tried it yet but it looks like exactly what I needed. I
tried "Spawn", "Execute", "Start" and several others, but I didn't think to
look up "Shell".
 
J

JWM6

The VBA shell command is as follows:

programPath = "C:\Program Files\Internet Explorer\iexplore.exe" '
works
'programPath = "iexplore.exe" ' does not work
Shell programPath + " " + fileToLaunch, vbNormalFocus

but the drawback is that the invoked program (iexplore.exe, at least in
my case) needs to have the FULL PATH to where the program exists = the
"C:\Program Files\Internet Explorer" which may or may not work on
someone elses computer. Is there a trick to find where the executing
program lives? This hardcoding will not work and is not transportable.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top