I am using VBA to capture all the areas put in a pivot table. The code is below
For Each objCubeFld In pvt.PivotFields 'Loop through all fields in PivotTable
Cubefield(i) = objCubeFld
Orient(i) = objCubeFld.Orientation 'Orientation
Pos(i) = objCubeFld.Position 'Position
i = i + 1
Next objCubeFld
However, I got below error.
I know when Orientation="3", it means filter. After removing the filter, the program runs fine. Could anyone explain this?