Ruined hyperlinks...

W

wildetudor

Hello everybody!

I have a spreadsheet that contains details about various TXT files: the
first column contains the files' names, and the following columns describe
various parameters of the files. Every cell in the first column is also a
hyperlink, to that particular file. The localisation of the files on the
hard-drive is such that each one is in its own subfolder in D:\Data\.

When I opened the spreadsheet today, I noticed that none of the links were
working, and when I checked the hyperlinks, they had all changed from
D:\Data\Subfolder\File.txt into C:\Documents and
Settings\Administrator\Application Data\Microsoft\Excel\Subfolder\file.txt

Can anyone suggest (1) why this might have happened all by itself (or what I
might have done that had this as an effect), and (2) how I can fix the links
(other than by manually correcting each hyperlink.. there are about 500 rows
in the spreadsheet!)

Thank you very much in advance for any help! :)

Catalin
 
D

Dave Peterson

Saved from a previous post:

A few people have said that this has stopped a similar problem from occurring.
Maybe it'll help you--but you'll have to test it to make sure.

In xl2003 menus:
File|Properties|Summary Tab|Hyperlink Base
change it to C:\
(something that's always available)

In xl2007:
Click on the Office button
Choose Prepare, then properties.
Then use the arrow on the Document Properties dropdown
Choose Advanced Properties
And then change the hyperlink base on the Summary tab.


I like to use the =hyperlink() worksheet function for this. I've never had one
of these worksheet functions change.

I'll put the path in a hidden cell (A1 in my example). (Include the trailing
backslash, too!)

Then put the filenames in A2:Axxx
Then use the =hyperlink() formula in B2:Bxx.

=hyperlink("File:////"&$a$1&a2,"Click me")
and drag down

Then when I need to change the folder, I can change it one location (A1).

I could embed the path directly in the formula:
=hyperlink("File:////c:\my documents\excel\"& a2,"Click me")
and use Edit|Replace, but that seems like more work to me.

========

If you used Insert|Hyperlink, then you've noticed that edit|replace won't touch
those hyperlink addresses.

If you used Insert|hyperlink (xl2003 menus), you'll have more work to do. But
the good news is David McRitchie has done most of it for you:

http://www.mvps.org/dmcritchie/excel/buildtoc.htm
look for:
Fix Hyperlinks (#FixHyperlinks)

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)
 

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