Morning, I have a Olap pivot table that I can't get to update
Using this code works fine
Sub Test()Dim Table As PivotTable
Dim Field As PivotField
Set Table = Worksheets("Pivot Sheet").PivotTables(1)
Set Field = Table.PivotFields("[Brand].[Brand].[Brand]") List = Field.VisibleItemsList
Field.VisibleItemsList = Array("[Brand].[Brand].&[APPLE]&[062]")
The pivot table updates the information perfectly, but if I want to select all the Brands in the pivot table the following does not update.
Sub Test()Dim Table As PivotTable
Dim Field As PivotField
Set Table = Worksheets("Pivot Sheet").PivotTables(1)
Set Field = Table.PivotFields("[Brand].[Brand].[Brand]") List = Field.VisibleItemsList
Field.VisibleItemsList = Array("")
I have recorded a macro to see how VBA does it, and it is pretty much the same.
I have tried unsuccessfully each of the following...
Running the Macro that VBA recorded.
Going to the Pivot Table toolbar and clicking refresh
Table.Update
Table.ManualUpdate = False / True
Table.RefreshTable
Table.PivotCache.Refresh
Swearing at it
How ever if I go the the Brand drop down, all the brands are selected, and if I press OK without changing the selection, then it updates fine.
It seems there are many people with similar problems, but I can't figure this out. Any ideas?
Thanks
Grant McConville
Bookmarks