Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Phoenix, Arizona, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Protecting Hyperlink in Excel 2010

    Is there a way to disable a hyperlink in a document besides removing the hyperlink?

    When I say protect, I mean a way to block one particular hyperlink in an Excel document that has no other protection.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    Could you elaborate and what you want? You have used 3 different terms: protecting, disable, and block. I am not sure what you want to accomplish.
    Some of the words suggest not allowing it to link, others suggest and inability to edit
    Steve

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Phoenix, Arizona, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry for the mixed terminology. What I want is for the link to not work when it is clicked on, if I do not want a certain person to have access to what the hyperlink would normally give them. Not allowing it to link is what I am going for. Can the cell that the hyperlink is in be protected?

  4. #4
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,639
    Thanks
    115
    Thanked 650 Times in 592 Posts
    Jantoles,

    Here is some code that will toggle a hyperiink between a website (activated) and the cell it resides in (inactivated). I have tied it to a button as the event but it could easily be tied to a workbook logon, worksheet protect, or any other means to segregate different users. The active hyperlink can be to a website, file, of a different cell anywhere in the workbook. The dead hyperlink is to the cell itself that will not do anything.

    In the attached image you can see that when the button caption states enabled, the hover shows the link to Google. When the caption shows disabled, the hover shows the link to itself.

    HTH,
    Maud

    LinkEnabled.png

    LinkDisabled.png

    Code:
    Private Sub CommandButton1_Click()
    If CommandButton1.Caption = "Link Disabled" Then
        [a1].Hyperlinks(1).Address = "http://www.google.com/"
        [a1].Hyperlinks(1).SubAddress = ""
        CommandButton1.Caption = "Link Enabled"
    Else:
        [a1].Hyperlinks(1).Address = ""
        [a1].Hyperlinks(1).SubAddress = "Sheet1!A1"
        CommandButton1.Caption = "Link Disabled"
    End If
    End Sub
    Attached Files Attached Files
    Last edited by Maudibe; 2013-10-04 at 18:36.

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Phoenix, Arizona, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much Maud. I really appreciate your help.

Posting Permissions

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