Here is the situation. I'm trying to record the filter settings of an OLAP based pivot table. I plan to switch sources to a different OLAP in a different program (but containing the same data) and then rebuild the pivot with new pivotfield and pivot item names. I have setting the fields done and the drill down done. The problem is that I have the vba to filter the rows, but it doesn't work on the columns.
When I record the Macro for filtering columns i get this:
What I need is a way to store the Hidden Items. In this case I would want to store "[Date].[Fiscal].[Fiscal Year].&[2006]", "[Date].[Fiscal].[Fiscal Year].&[2008].
I have tried cycling through each item with code like this but the items that are hidden never get cycled through. Its almost as if they don't exist.
Finally, I have tried replacing the .HiddenItemsList with .VisibleItemsList and I get an application defined or object defined error.
Any Help on this would be greatly appreciated. Or just an Idea of WHY VisibleItemsList works for rowfields but not columnfields.
Thank you
When I record the Macro for filtering columns i get this:
Code:
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Fiscal].[Fiscal Year]").HiddenItemsList = Array( _
"[Date].[Fiscal].[Fiscal Year].&[2006]", "[Date].[Fiscal].[Fiscal Year].&[2008]")
What I need is a way to store the Hidden Items. In this case I would want to store "[Date].[Fiscal].[Fiscal Year].&[2006]", "[Date].[Fiscal].[Fiscal Year].&[2008].
I have tried cycling through each item with code like this but the items that are hidden never get cycled through. Its almost as if they don't exist.
Code:
For Each t In .PivotItems
MsgBox (t.Name)
If t.Visible = False Then MsgBox (t.Name & " is hidden")
Next
Finally, I have tried replacing the .HiddenItemsList with .VisibleItemsList and I get an application defined or object defined error.
Any Help on this would be greatly appreciated. Or just an Idea of WHY VisibleItemsList works for rowfields but not columnfields.
Thank you