S
Sharon
Hi I need to ensure that users can't edit the queries underlying pivot
tables. I don't want to turn sheet protection on and off as this has caused
problems with corrupting the pivots. I am using the following code and it
just ain't working:
Public Sub ProtectPivots()
Dim ws As Worksheet
Dim QueryTables As QueryTables
Dim Query As QueryTable
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
Range("B8").Activate
For Each Query In ws.QueryTables
Query.EnableEditing = False
Next
Next
End Sub
If anybody can see my blunder I would be really grateful (again!!). Thanks
tables. I don't want to turn sheet protection on and off as this has caused
problems with corrupting the pivots. I am using the following code and it
just ain't working:
Public Sub ProtectPivots()
Dim ws As Worksheet
Dim QueryTables As QueryTables
Dim Query As QueryTable
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
Range("B8").Activate
For Each Query In ws.QueryTables
Query.EnableEditing = False
Next
Next
End Sub
If anybody can see my blunder I would be really grateful (again!!). Thanks