Launch program using Shell function

P

PJ

Is it possible to launch an external program using VBA without specifying the
application path? I want to launch a program where the location of the
executable will vary based on the version installed on the users machine.
The executable is the same regardless of the version installed and it appears
there are at least four versions (and four locations) that could be present
on the users machine.

So instead of this:
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)

is there any way to achieve something like this:
RetVal = Shell(CALC.EXE, 1)
 
P

PJ

Thanks Rick, I initially tried with and without quotes and it didn't work. I
paid no mind to the error as I thought had to do with the syntax but I can
see now that the application is not listed in my path statement and therein
lies my problem. I will have to look for an alternative solution but thanks
for confirming the syntax.

PJ
 
R

Rick Rothstein

I thought the CALC.EXE program resided in the System32 directory which I
thought was guaranteed to be in the Windows Path setting.
 

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