Quantcast
Viewing all articles
Browse latest Browse all 5414

Remove workbook protection in VBA

Hi


In V7.5 I have used the "normal" way of removing protection on a report in order to allow eg grouping of rows/columns.


Private Sub Workbook_Activate()

Dim i As Integer
For i = 1 To Worksheets.Count
    With Sheets(i)
      .Unprotect Password:="mypassword"
      .EnableOutlining = True
      .Protect Password:="mypassword", UserInterfaceOnly:=True
    End With
Next

End Sub



It seems as if this function is not working in V10.


Do any of you know how to create a macro unprotecting the reports so the users can group/ungroup columns or rows?


Regards,

Lars


Viewing all articles
Browse latest Browse all 5414

Trending Articles