Opening a .exe file from an excel hyperlink

  • Thread starter Thread starter furbiuzzu
  • Start date Start date
F

furbiuzzu

i've a problem.

I have to distribute an excel file containing an hyperlink to a
external program that is supposed to be in users' PC.

the problem is i don't know where this file is saved inside other users
HD then i can't create a universal hyperlink to open it directly from
the excel file.

this external program have its own installation folder and its .exe
icon but, i can not know in which disk is located.

so how can i create a universal hyperlink able to open this .exe file
from its real path???

thx !
 
The only solution I could think of is if the user created a link to it on
their desktop with a common name, you could hyperlink to the desktop link.
Or (and that doesn't sound practical), have code search their drives to find
the file, then create the hyperlink. You could do that in some form of
installation program.
 
tanks for your answer.

i've tried many solution but the best one i found is to leave
unprotected the "hyperlink" cell so that users can create "their own
path" inside their disk.

Another question...

Does a "universal" path to ProgramFiles Folder exist ??

something like %ProgramFiles% i mean...
(i've tried it but doesn't work)

I know that the program i've to launch has an instalaltion directory
that it's supposed to be:

C:\\ProgramFiles (or Programmi for italian users) \ JEAHPE \JEAHPE.exe

but if the directory it's in another disk ( G: ; F: ; Z:???) how can i
solve this problem ??

thx again !
 
MsgBox Environ("ProgramFiles")

--
Jim
| tanks for your answer.
|
| i've tried many solution but the best one i found is to leave
| unprotected the "hyperlink" cell so that users can create "their own
| path" inside their disk.
|
| Another question...
|
| Does a "universal" path to ProgramFiles Folder exist ??
|
| something like %ProgramFiles% i mean...
| (i've tried it but doesn't work)
|
| I know that the program i've to launch has an instalaltion directory
| that it's supposed to be:
|
| C:\\ProgramFiles (or Programmi for italian users) \ JEAHPE \JEAHPE.exe
|
| but if the directory it's in another disk ( G: ; F: ; Z:???) how can i
| solve this problem ??
|
| thx again !
|
 
you're a genius!

now, how can i copy automatically to my hyperlink the messagebox
result???
 
Done !!!!!

thank you so much !!!!!

that's the result

Sub jeahpe2()
'
' jeahpe2 Macro
' Macro registrata il 08/11/2005 da fulvio
'
Dim programfile As String

Range("A31").Select
programfile = Environ("ProgramFiles")
ActiveSheet.Hyperlinks.Add Anchor:=selection, Address:= _
programfile & "\JEAHPE\JEAHPE.exe", TextToDisplay:= _
"JEAHPE.exe"
Range("A31").Select
selection.Hyperlinks(1).Follow NewWindow:=True, AddHistory:=True

End Sub
 
I doubt this is an issue for you, but just for information, the environ
variable for ProgramFiles is not predefined in Windows 9X (at least it isn't
in xl 98 SE).

to illustrate from the immediate window:

programfile = Environ("ProgramFiles")
? "=>" & programFile & "<="
=><=
 

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

Back
Top