View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Debra Dalgleish Debra Dalgleish is offline
external usenet poster
 
Posts: 2,979
Default Pivot Table Pivot Item Visible - Why so difficult

Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:
A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html