• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

adding to VBA Code for using Expand groups in protected mode

Sharon Slatter

New Member
Hi All,

I am using the below code so I can open expanded groups of data in protected mode, is there anyway of adding to this code so that I am able to still insert Hyperlinks, I know I can click on inset hyperlinks when ordinarily protecting a sheet but to enable the expand groups I have to use this code.

Can anyone advise how to adapt this code to suit.

Code:
Option Explicit

Private Sub Workbook_Open()

    With Worksheets("Hours")

        .Protect Password:="priory123", userinterfaceonly:=True

        .EnableOutlining = True

        .EnableAutoFilter = True

        If .FilterMode Then

           .ShowAllData

        End If

    End With

End Sub
 
Last edited by a moderator:
Just add AllowHyperlink in your .Protect code.

Code:
.Protect Password:="priory123", userinterfaceonly:=True, AllowInsertingHyperlinks:=True
 
Back
Top