Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I received the following code from Debra Dalgleish, to password protect all
worksheets, setting certain exceptions for objects, etc. Public Sub ProtectAll() Const PWORD As String = "mysecretword" Dim wsSheet As Worksheet For Each wsSheet In Worksheets wsSheet.Protect Password:=PWORD, _ DrawingObjects:=False, _ AllowFiltering:=True, _ AllowUsingPivotTables:=True Next wsSheet End Sub It works well, except for one thing: when I open the file, I get an error message which emanates from the fact that I have selected "refresh automatically" in the Pivot Table Options (the problem disappears when I deselect the auto refresh box). I really don't want to disable that feature, therefore, for the time being I go to the worksheet containing the Pivot Table and manually remove all protection. I presume that there is a way to resolve this conflict with VBA. Thanks for your help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Table Protection | Excel Discussion (Misc queries) | |||
pivot table - keep text wrapped on refresh? | Excel Worksheet Functions | |||
Pivot Table Refresh Problems | Excel Discussion (Misc queries) | |||
Printing a Pivot Table from code - Excel 2003 | Excel Discussion (Misc queries) | |||
ability to auto file column(s) on a pivot table | Excel Worksheet Functions |