Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    Leeds, West Yorkshire, UK
    Posts
    12

    Question Unanswered: 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

  2. #2
    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 13:30.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •