Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Force *relative* path in Insert Hyperlink dialog

Googling this question turned up a lot of people with the *opposite*
problem, so I must be overlooking something obvious. The issue arises
on 2 different PCs, running Excel 2000 and 2003, both with WinXP.

I have several hundred files to be hyperlinked from a spreadsheet. When
done they're all destined for a CD. So I figure we need all the
hyperlink paths to be relative, that is, the address field for each link
should be in the form \path\stuff.txt and not D:\path\stuff.txt (nor any
other letter plus :\stuff.txt).

But no matter what I enter in 'Hyperlink Base' in File- Properties-
Summary, when I pick a cell in the sheet, click Insert- Hyperlink, and
BROWSE to a file to be linked, that file's full ABSOLUTE path gets inserted.

Is there a way to disable that? I see tons of posts saying you can
*type* the file's relative path, but oddly enough, nobody mentions how
convenient it would be if you could make the Browse button automatically
OMIT the drive prefix, i.e., automatically insert said relative path.
That's why I'm convinced something obvious has escaped me. Is there no
way to make it do that?

I know I can de-absolute all the links at once afterward with a little
macro that cycles through them & applies the VBA Replace function, but
that seems like sort of a backward way to do it. Am I crazy? (Shh!)

If the answer is bonehead simple, I promise to slink quietly back into
my cave.

TIA!!
Mark Tangard
"Life is nothing if you're not obsessed." --John Waters


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Force *relative* path in Insert Hyperlink dialog

Mark

If you leave the hyperlink base blank, then all hyperlinks will be relative
to the workbook that contains them - with a few exceptions. If the file is
on a different drive or network share, the path will be absolute because
there's no way show a relative path across drives.

Also, note that if the workbook to which you are inserting hyperlinks is
unsaved, the hyperlink path will be absolute until you save it. That's
because the workbook doesn't have a path to which to be relatve. Once you
save the workbook, however, the path will become relative. The
TextToDisplay will NOT become relative in that situation, though, so be sure
you're looking at the Address property of the hyperlink and not just what is
shows in the cell.

If that doesn't answer your question, can you give me more details about
where your files are and what kind of results you're getting. I'll try to
reproduce it.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Mark Tangard wrote:
Googling this question turned up a lot of people with the *opposite*
problem, so I must be overlooking something obvious. The issue arises
on 2 different PCs, running Excel 2000 and 2003, both with WinXP.

I have several hundred files to be hyperlinked from a spreadsheet. When
done they're all destined for a CD. So I figure we need all the
hyperlink paths to be relative, that is, the address field for each
link should be in the form \path\stuff.txt and not D:\path\stuff.txt
(nor any other letter plus :\stuff.txt).

But no matter what I enter in 'Hyperlink Base' in File- Properties-
Summary, when I pick a cell in the sheet, click Insert- Hyperlink,
and BROWSE to a file to be linked, that file's full ABSOLUTE path
gets inserted.
Is there a way to disable that? I see tons of posts saying you can
*type* the file's relative path, but oddly enough, nobody mentions how
convenient it would be if you could make the Browse button
automatically OMIT the drive prefix, i.e., automatically insert said
relative path. That's why I'm convinced something obvious has escaped
me. Is there no way to make it do that?

I know I can de-absolute all the links at once afterward with a little
macro that cycles through them & applies the VBA Replace function, but
that seems like sort of a backward way to do it. Am I crazy? (Shh!)

If the answer is bonehead simple, I promise to slink quietly back into
my cave.

TIA!!
Mark Tangard
"Life is nothing if you're not obsessed." --John Waters



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Force *relative* path in Insert Hyperlink dialog

If you leave the hyperlink base blank, then all hyperlinks will be relative
to the workbook that contains them - with a few exceptions.


Gawd. Didn't realize it'd be *that* simple. Thanks so much for recognizing my
blind spot. But, what are the exceptions?

Mark Tangard

Dick Kusleika wrote:
Mark

If you leave the hyperlink base blank, then all hyperlinks will be relative
to the workbook that contains them - with a few exceptions. If the file is
on a different drive or network share, the path will be absolute because
there's no way show a relative path across drives.

Also, note that if the workbook to which you are inserting hyperlinks is
unsaved, the hyperlink path will be absolute until you save it. That's
because the workbook doesn't have a path to which to be relatve. Once you
save the workbook, however, the path will become relative. The
TextToDisplay will NOT become relative in that situation, though, so be sure
you're looking at the Address property of the hyperlink and not just what is
shows in the cell.

If that doesn't answer your question, can you give me more details about
where your files are and what kind of results you're getting. I'll try to
reproduce it.

-- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Mark Tangard
wrote:

Googling this question turned up a lot of people with the *opposite*
problem, so I must be overlooking something obvious. The issue arises
on 2 different PCs, running Excel 2000 and 2003, both with WinXP.

I have several hundred files to be hyperlinked from a spreadsheet. When
done they're all destined for a CD. So I figure we need all the
hyperlink paths to be relative, that is, the address field for each
link should be in the form \path\stuff.txt and not D:\path\stuff.txt
(nor any other letter plus :\stuff.txt).

But no matter what I enter in 'Hyperlink Base' in File- Properties-
Summary, when I pick a cell in the sheet, click Insert- Hyperlink,
and BROWSE to a file to be linked, that file's full ABSOLUTE path
gets inserted.
Is there a way to disable that? I see tons of posts saying you can
*type* the file's relative path, but oddly enough, nobody mentions how
convenient it would be if you could make the Browse button
automatically OMIT the drive prefix, i.e., automatically insert said
relative path. That's why I'm convinced something obvious has escaped
me. Is there no way to make it do that?

I know I can de-absolute all the links at once afterward with a little
macro that cycles through them & applies the VBA Replace function, but
that seems like sort of a backward way to do it. Am I crazy? (Shh!)

If the answer is bonehead simple, I promise to slink quietly back into
my cave.

TIA!!
Mark Tangard
"Life is nothing if you're not obsessed." --John Waters


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Force *relative* path in Insert Hyperlink dialog

Mark Tangard wrote:
If you leave the hyperlink base blank, then all hyperlinks will be
relative to the workbook that contains them - with a few exceptions.


Gawd. Didn't realize it'd be *that* simple. Thanks so much for
recognizing my blind spot. But, what are the exceptions?


The ones I mentioned: Unsaved workbook results in absolute links until you
save it; and links on a different drive or path. There may be more
exceptions, but those are the two I know.


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com


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
Default Insert Hyperlink Path excel 2007 Jason Blake Links and Linking in Excel 2 April 28th 23 03:44 AM
Remove content of last visited pages in "Insert Hyperlink" dialog Excel bloke Excel Worksheet Functions 4 June 12th 06 12:37 AM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Macro to Force Response in Dialog Box JenReyn Excel Programming 1 January 10th 04 01:12 AM


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

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

About Us

"It's about Microsoft Excel"