+ Reply to Thread
Results 1 to 3 of 3

Attach hyperlink to shape/image

  1. #1
    Registered User
    Join Date
    02-25-2011
    Location
    the hague
    MS-Off Ver
    Excel 2007
    Posts
    5

    Attach hyperlink to shape/image

    I have been searching on several forums to find a way to attach a DYNAMIC hyperlink to a shape or an image in Excel 2007.

    I have find the following "solution" which worked for me in a NEW/clean workbook.

    Sub Picture33_Click()
    Worksheets(1).Range("B31").Hyperlinks(1).Follow NewWindow:=True
    End Sub

    BUT, when I copied this into the workbook, I already was working on, everytime I got an error in line 2.

    Can somebody tell me what I should do to solve this ? Does it have something to do with the location I copied the code to (workbook instead of module) ? PLEASE HELP !

    (the DYNAMIC hyperlink is located in cell B31 and should be activated when clicked on Picture33). I guess, since the hyperlink should be dynamic, the HYPERLINK function is not an alternative.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Attach hyperlink to shape/image

    Hi,
    What is the error and what do you have in B31?What is supposed to happen?

  3. #3
    Registered User
    Join Date
    02-25-2011
    Location
    the hague
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Attach hyperlink to shape/image

    cell B31 will be something like http://www.google.com or to make it more dynamic ="http://www.google.com/"&A1 ... in which A1 relates to the string with the search term. It should open the webbrowser with the http-address.

    As far as the error is concerned: "run time error "9" subcript out of range"
    Last edited by patrickw; 02-26-2011 at 03:00 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1