I've been maintaining a protected workbook for ages. With the newest iteration I get a "You cannot use this command on a protected sheet..." error. Members of my team can expand/collapse the rows but my sales team (the end users) cannot. Is there something wrong with this code that I'm missing?
Sub allowGroup()
'macro that runs to allow grouping in protected worksheet
Dim mySheet As Worksheet
Set mySheet = Application.ActiveSheet
Dim myPW As String
myPW = Application.InputBox("Type one Password to protect your worksheet:", "allowGroup", "", Type:=2)
ActiveSheet.Protect Password:="PASSWORD", AllowFormattingCells:=True
mySheet.EnableOutlining = True
End Sub
Thanks for the help!
Sub allowGroup()
'macro that runs to allow grouping in protected worksheet
Dim mySheet As Worksheet
Set mySheet = Application.ActiveSheet
Dim myPW As String
myPW = Application.InputBox("Type one Password to protect your worksheet:", "allowGroup", "", Type:=2)
ActiveSheet.Protect Password:="PASSWORD", AllowFormattingCells:=True
mySheet.EnableOutlining = True
End Sub
Thanks for the help!