If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Hyperlink Creation in VBA

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-04, 09:36
PostalPete PostalPete is offline
Registered User
 
Join Date: Sep 2003
Location: Leeds, West Yorkshire, UK
Posts: 12
Question Hyperlink Creation in VBA

Hi All,

Could anyone shed any light on how I can stop excel from automatically selecting the hyperlink as a relative path?


I create the hyperlink in VBA:

ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:="C:\SomeFolder\Doc.doc"

Cheers,

Pete
Reply With Quote
  #2 (permalink)  
Old 05-07-04, 12:27
actuary actuary is offline
Registered User
 
Join Date: Mar 2004
Location: Fort Worth, Texas, USA
Posts: 68
I can't reproduce in Office XP, so I guess Office XP is one solution.

Another possible solution in to make sure to save the spreadsheet in a different directory than the hyperlink target, possibly forcing Excel to keep the entire path.

Or try:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:="file:///C:\SomeFolder\Doc.doc"

Last edited by actuary; 05-07-04 at 12:30.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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