Restricting Pivot Tables
I have a pivot table I wish to distribute to users but wish to restrict what
they can do thereafter.
But when I run the code below it gives me an error:438 object doesn't support this property or method.
Please help!
Sub RestrictPivotTable()
Dim pf As PivotField
With ActiveSheet.PivotTables(1)
..EnableFieldList = True 'False
..EnableWizard = False 'false
..EnableDrilldown = True
..EnableFieldDialog = True
..PivotCache.EnableRefresh = True
..EnableFieldList = True 'False
For Each pf In .PivotFields
With pf
'.DragToPage = False
'.DragToRow = False
'.DragToColumn = False
' .DragToData = False
'.DragToHide = False
End With
Next pf
End With
End Sub
I have a pivot table I wish to distribute to users but wish to restrict what
they can do thereafter.
But when I run the code below it gives me an error:438 object doesn't support this property or method.
Please help!
Sub RestrictPivotTable()
Dim pf As PivotField
With ActiveSheet.PivotTables(1)
..EnableFieldList = True 'False
..EnableWizard = False 'false
..EnableDrilldown = True
..EnableFieldDialog = True
..PivotCache.EnableRefresh = True
..EnableFieldList = True 'False
For Each pf In .PivotFields
With pf
'.DragToPage = False
'.DragToRow = False
'.DragToColumn = False
' .DragToData = False
'.DragToHide = False
End With
Next pf
End With
End Sub