LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
iD iD is offline
external usenet poster
 
Posts: 2
Default PivotItems.Count is 0 when items are visible on the sheet

Hi All
I have a Pivot Table report (Excel 2003 sp1) connecting to a cube on
SQL Server 2000 (sp 3a) and am trying to enumerate through a pivot
field so that I can print a report for each item in it.

On the worksheet there are 20 or so items selectable, but when I try
to select one through code, the items count is 0.

Below is a fragment of code that I am using (taken from other
postings!):

'
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem

Set pt = ActiveSheet.PivotTables.Item("PivotTable1")

' this is ok as I can do pf.Name
Set pf = pt.PivotFields("[Department]")

' this always displays 0
MsgBox pf.PivotItems.Count
'

Does anyone have any sugestions please?!?!

I have tried ChildItems and also working through CubeFields but by the
time I get to PivotItems it all ends!!!

Incidently ColumnFields seems ok, but I can't use this because of the
way I have to format the report.


Many thanks for any help/suggestions
iD
 
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
Controlling Pivotitems.visible sxhwabbiemike Excel Discussion (Misc queries) 0 January 21st 09 03:09 AM
Pivot Change PivotItems - Visible/Hide with VBA [email protected] Excel Worksheet Functions 3 January 6th 07 12:26 AM
Count Filtered Visible Items that Match Numeric Criteria between two ranges Sam via OfficeKB.com Excel Worksheet Functions 4 September 20th 06 06:39 PM
Excel Pivot Tables, Page Fields, Visible PivotItems, Activation Ananda Sim Excel Programming 1 September 10th 04 01:57 AM
Add PivotItems to PivotTable / Enabling - Disabling PivotItems Ole[_3_] Excel Programming 1 July 8th 03 03:24 PM


All times are GMT +1. The time now is 10:40 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"