Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Links / November 2007

Tip: Looking for answers? Try searching our database.

G'day ... Linking to .exe file help required.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kelly Armitage - 22 Nov 2007 21:14 GMT
I have an excel sheet and would like to have a hyper link in one of the cells
exceute and .exe file, this part I can do and it work (with a couple annoying
warning I know I can disable), however my issue is that the .exe I want to
run has a "Switch" or two after it which is what makes linking it from Excel
useful, however as soon as I use the switch, in the hyperlink after the
executable name, it tells me it cannot find the specified file.

Does anyone know how I can make this work or a workaround for it?
example hyper link would be c:\program files\program.exe <-- that works fine
but c:\program files\program.exe -switch <---fail to find the executable ?

thanks for any tips
Bill Manville - 24 Nov 2007 08:44 GMT
I can't see any way to make that work.
I would approach it differently (assuming you can have macros in your
file) and use a VBA Shell command to run the program.

For example, if you wanted double-clicking any cell in column C to run
your program, with "-" & the content of that cell as a switch, you
could use a Worksheet_BeforeDoubleClick procedure in the module of the
sheet

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
 If Target.Cells.Count = 1 And Target.Column = 3 Then
   Shell """C:\Program Files\Program.exe"" -" & Target.Value, _
         vbNormalFocus
   Cancel = True
 End If
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.