LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default PivotTable Problem

Here are two macros I RECORDED to collapse and expand the data viewed in a
pivot table.

Sub CollapseView()

With ActiveSheet.PivotTables("PivotTable2").PivotFields ("Status")
.PivotItems("C").Visible = False
.PivotItems("PA").Visible = False
.PivotItems("PE").Visible = False
.PivotItems("PU").Visible = False
.PivotItems("PX").Visible = False
End With
End Sub

Sub ExpandView()

With ActiveSheet.PivotTables("PivotTable2").PivotFields ("Status")
.PivotItems("C").Visible = True
.PivotItems("PA").Visible = True
.PivotItems("PE").Visible = True
.PivotItems("PU").Visible = True
.PivotItems("PX").Visible = True
End With
End Sub

Sub CollapseView works just fine. When I try to run ExpandView I get Error
Message 1004 - " Unable to set the Visible property of the PivotItem class."
I am not able to change any of the PivotItems with this code.

I do not understand why I can programtically set the visible property to
false but can't set it to true. This is the first time I have not been able
to run code that I recorded. Any ideas on what is happening here would be
much appreciated.
--
Stan Shoemaker
Palo Alto, CA
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivottable getpivotdata problem Mikmac Excel Worksheet Functions 2 October 30th 09 01:17 PM
problem with pivotTable in Excel [email protected] Excel Discussion (Misc queries) 1 June 4th 08 02:36 PM
Pivottable Problem mmwheeler Charts and Charting in Excel 1 August 4th 05 04:08 AM
Excel PivotTable C# problem Markus Excel Programming 0 August 13th 04 12:24 AM
Calculation problem in pivottable Roger[_14_] Excel Programming 0 January 20th 04 10:01 AM


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"