snichols101
New Member
- Joined
- Oct 26, 2016
- Messages
- 4
Hi All
I have the following macro assigned to a macro button which refreshes 2 hidden pivot tables from a protected worksheet and brings back the refreshed data;
The marco works when sheets are unprotected, but fails (Run time error '1004') when sheets are protected. I've tried 'unprotecting' code but with no avail. Can anybody help?
Thanks
I have the following macro assigned to a macro button which refreshes 2 hidden pivot tables from a protected worksheet and brings back the refreshed data;
Sub Refresh()
' Refresh Macro
Worksheets("Pivot").PivotTables("PivotTable1").PivotCache.Refresh
Worksheets("Pivot3").PivotTables("PivotTable3").PivotCache.Refresh
End Sub
The marco works when sheets are unprotected, but fails (Run time error '1004') when sheets are protected. I've tried 'unprotecting' code but with no avail. Can anybody help?
Thanks