Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Opening a .exe file from an excel hyperlink

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 !

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Opening a .exe file from an excel hyperlink

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.

--
Regards,
Tom Ogilvy


"furbiuzzu" wrote in message
oups.com...
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 !



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Opening a .exe file from an excel hyperlink

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 !

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Opening a .exe file from an excel hyperlink

Take a look he

http://support.microsoft.com/default...b;en-us;191198
SAMPLE: SFOLDER.EXE Gets the Path of a Special Folder

--
Regards,
Tom Ogilvy





"furbiuzzu" wrote in message
ups.com...
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 !



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Opening a .exe file from an excel hyperlink

thx.... i'll take a look but it seems too complicated for a newbie like
me.....



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Opening a .exe file from an excel hyperlink

MsgBox Environ("ProgramFiles")

--
Jim
"furbiuzzu" wrote in message
ups.com...
| 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 !
|


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Opening a .exe file from an excel hyperlink

you're a genius!

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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Opening a .exe file from an excel hyperlink

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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Opening a .exe file from an excel hyperlink

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 & "<="
=<=


--
Regards,
Tom Ogilvy


"furbiuzzu" wrote in message
ups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
opening a file with a hyperlink des-sa[_2_] Excel Discussion (Misc queries) 0 June 8th 08 10:23 AM
Pdf hyperlink not opening in excel worksheet - nothing appears. Yaser Excel Worksheet Functions 1 May 2nd 08 06:42 PM
hyperlink is opening file with wrong program Jordan Excel Discussion (Misc queries) 0 November 20th 07 06:07 PM
Hyperlink 4 Opening More Than 1 File. FARAZ QURESHI Excel Discussion (Misc queries) 4 November 12th 07 09:48 PM
Problem opening hyperlink to PDF file in Excel 2003 helenyw New Users to Excel 2 December 7th 06 01:41 PM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"