Results 1 to 3 of 3

Thread: Hyperlink

  1. #1
    2 Star Lounger
    Join Date
    Apr 2015
    Posts
    153
    Thanks
    70
    Thanked 0 Times in 0 Posts

    Hyperlink

    Hi Experts,

    I have a label on a form as follows:

    LblHLink.Caption = ActiveCell.Offset(, 11).Value

    I am working on using a click event to follow the hyperlink showing in the label. I've tried many approaches. So far, none have worked.

    For example:

    ActiveWorkbook.FollowHyperlink Address:=link, NewWindow:=True
    LblHLink.Caption = ActiveCell.Offset(, 11).Hyperlinks
    LblHLink.Caption = ThisWorkbook.FollowHyperlink
    ThisWorkbook.FollowHyperlink Address:=LblHLink
    ActiveWorkbook.FollowHyperlink Address:=URL, NewWindow:=True

    Any ideas or suggestion would be appreciated.

  2. #2
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,640
    Thanks
    115
    Thanked 651 Times in 593 Posts
    Excel,

    This code should work in a userform:

    Code:
    Private Sub Label1_Click()
    Dim WebBrowser1 As InternetExplorer
    Set WebBrowser1 = New InternetExplorer
    link = Label1.Caption
    WebBrowser1.Visible = True
    WebBrowser1.navigate2 link
    Do
    DoEvents
    Loop Until WebBrowser1.ReadyState = 4
    End Sub
    You will need to reference the Microsoft Internet Controls in the VB editor

    HTH,
    Maud

  3. The Following User Says Thank You to Maudibe For This Useful Post:

    Excelnewbie (2016-05-09)

  4. #3
    2 Star Lounger
    Join Date
    Apr 2015
    Posts
    153
    Thanks
    70
    Thanked 0 Times in 0 Posts
    Maud,

    I'll try this out. Thanks for responding to my question. Much appreciated.

Posting Permissions

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