hi
i protected the sheets in my workbook
i unlocked the slicers
i have a PQ refresh macro which protecs/unprotects to refresh
after each refresh the slicers get locked again
what would i add to my code to leave my slicers enabled?
i protected the sheets in my workbook
i unlocked the slicers
i have a PQ refresh macro which protecs/unprotects to refresh
after each refresh the slicers get locked again
what would i add to my code to leave my slicers enabled?
Rich (BB code):
Sub RefreshPQActiveWorkbook()
If MsgBox("Do you want to refresh?", vbOKCancel + vbQuestion) = vbCancel Then
Exit Sub
End If
Dim ActSheet As String
ActSheet = ActiveSheet.Name
'ThisWorkbook.Activate
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Call WSUnProtect(ws)
Next ws
ActiveWorkbook.RefreshAll
For Each ws In ActiveWorkbook.Worksheets
Call WSProtect(ws)
Next ws
Worksheets(ActSheet).Activate
MsgBox "Refresh complete", vbInformation
'Turn off events, close SD, and Turn events back on
Application.EnableEvents = False
Application.EnableEvents = True
Application.ScreenUpdating = True
ActiveSheet.Activate
End Sub