Hi All, I am trying to set a filter value to a pivot to be a constant when there is no real data in the pivot datasource.
The VBA code is as below -
ActiveSheet.PivotTables("PT01").PivotFileds("FIELD01").PivotFilters.Add Type:=[FONT="]xlCaptionEquals[/FONT], Value1:="FIELDVAL"
I am getting the error " Object does not support this property or method"
As an alternative I tried
ActiveSheet.PivotTables("PT01").PivotFields("FIELD01"). _
ClearAllFilters
ActiveSheet.PivotTables("PT01").PivotFields("FIELD01"). _
PivotFilters.Add _
Type:=[FONT="]xlCaptionEquals[/FONT], Value1:="FIELDVAL"
The code executes till ClearAllFilters. Thereafter I get an Applicaton defined or object defined error
Please advise. Thanks
The VBA code is as below -
ActiveSheet.PivotTables("PT01").PivotFileds("FIELD01").PivotFilters.Add Type:=[FONT="]xlCaptionEquals[/FONT], Value1:="FIELDVAL"
I am getting the error " Object does not support this property or method"
As an alternative I tried
ActiveSheet.PivotTables("PT01").PivotFields("FIELD01"). _
ClearAllFilters
ActiveSheet.PivotTables("PT01").PivotFields("FIELD01"). _
PivotFilters.Add _
Type:=[FONT="]xlCaptionEquals[/FONT], Value1:="FIELDVAL"
The code executes till ClearAllFilters. Thereafter I get an Applicaton defined or object defined error
Please advise. Thanks