Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute program from cell reference

Status
Not open for further replies.

eggohead

Technical User
Oct 19, 2003
25
US
Hello.

I am trying to run a program with parameters referenced from a list in excel:

row a contains a list of variable parameters
row b contains a static reference to an executable c:\myapp.exe
row c combines the executable and varaiable into a complete command line using &: For example c:\myap.exe /variable1


I have tried using the hyperlink function to no avail. I can get the executable to work as long as there are no parameters. file:///c:\myap.exe works great however once you add a parameter it fails i.e. file://c:\myapp.exe /a

I have tried every method I could think of to get the hyperlink function to take a parameter so I dont think this will work. Since hyperlink uses the prefix file:/// for local files I also tested this from the run prompt with equal results.

My question is what code could I use to open the application with parameters when I click on the cell or link? This would be for every cell in the c column which contains the full command line.

This could also work calling cmd.exe if necessary. -not sure what is the easiest way to accomplish this.

- thanks for your time


 
A starting point:
CreateObject("WScript.Shell").Run "c:\myapp.exe /a", , True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top