hyperlink files on multiple computers

D

Doug

I currently have many hyperlinks to files that are in a single folder named
Training Cycles on my computer. If I want to transfer this to another
computer to be used also, how can I do this without changing all the file
extensions. For example, on one computer the file extention might be
"C:\Users\The King's\Documents\Training Cycles" and on another computer the
extension might be "C:\Users\John Doe's\Documents\Training Cycles". How can
I make this work?
--
 
L

Luke M

Check out the XL help file article "Set the base address for the hyperlinks
in a workbook" for a nice way to setup hyperlinks if you know you need to
change the base address.

The other way (and my personal preference) is to use the HYPERLINK formula.
Then you would be able to do a Find & Replace, or even use a little VB to get
the username of an individual and plug it into the formula.
 
J

Jim Cone

If you referring to the "My Documents" folder as the parent folder
for the "Training Cycles" folder then you can determine that path on
any Windows XP system using the SpecialFolders property of
the Windows Script Host...
1. Create a user designed function (UDF) to return that folder path.
2. Use the returned path in the Hyperlink function...

'--
Function MyLocation() As String
Dim WSHShell As Object
Dim MyPath As String

Set WSHShell = CreateObject("WScript.Shell")
MyPath = WSHShell.SpecialFolders("MyDocuments")
MyPath = MyPath & "\Training Cycles"
MyLocation = MyPath
Set WSHShell = Nothing
End Function
'--

On a worksheet...
=HYPERLINK(MyLocation(),"nice name")

--
Jim Cone
Portland, Oregon USA





"Doug" <[email protected]>
wrote in message
I currently have many hyperlinks to files that are in a single folder named
Training Cycles on my computer. If I want to transfer this to another
computer to be used also, how can I do this without changing all the file
extensions. For example, on one computer the file extention might be
"C:\Users\The King's\Documents\Training Cycles" and on another computer the
extension might be "C:\Users\John Doe's\Documents\Training Cycles". How can
I make this work?
--
 
D

Doug

So do I enter the first part of this under the view code for that sheet and
then enter the second part in the hyperlink for that cell?
 
J

Jim Cone

Almost...
The code goes in a standard/regular module.
After you access the sheet module (View Code) from the Sheet Tab
right-click popup menu, on the module menu bar click Insert | Module and
paste the code in the new module.

The formula can then be used in any worksheet in the workbook.
(replace "nice name" with your preference but include the quote marks)
--
Jim Cone
Portland, Oregon USA




"Doug" <[email protected]>
wrote in message
So do I enter the first part of this under the view code for that sheet and
then enter the second part in the hyperlink for that cell?
 
D

Doug

It must be different on Vista. It is not working... I noticed that it is
called Documents instead of My Documents on Vista so I made that change and
still no such luck.
 

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