Private Sub Workbook_Open()
Dim WS_Count As Integer
Dim I As Integer
WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count
With ActiveWorkbook.Worksheets(I)
If .PivotTables.Count > 0 Then
.Unprotect ("reportingcg")
Else
.EnableAutoFilter = True
.EnableOutlining = True
.Protect contents:=True, Password:="reportingcg", userInterfaceOnly:=True
End If
End With
Next I
End Sub