Hi,
Using Excel 2003
This code tries to filter a pivot table using VBA:
I get an error "Unable to set the visible property of the pivotiten class" when trying to set pivItem.Visible = true
Why?
I declare pivItem as PivotItem and machine is a string
Using Excel 2003
This code tries to filter a pivot table using VBA:
I get an error "Unable to set the visible property of the pivotiten class" when trying to set pivItem.Visible = true
Why?
I declare pivItem as PivotItem and machine is a string
Code:
For Each pivItem In pivt.PivotFields(machine).PivotItems
pivt.ManualUpdate = True
pivt.PivotFields(machine).AutoSort xlManual, machine
If pivItem.Visible = False Then
pivItem.Visible = True
End If
pivt.ManualUpdate = False
Next