Microsoft Office Tutorials and References
In Depth Information
20.8.3 OptimizeCache Property
20.8.3 OptimizeCache Property
Cache optimization is used with large or complex source data. It will slow the initial construction
of the cache. This read-write Boolean property can be used to set cache optimization.
Unfortunately, the precise consequences of cache optimization are not made clear in the
documentation, leaving us to use trial and error to decide whether it should be employed. Perhaps
the best strategy is to leave this property set to its default ( False ) unless performance seems to be
a problem.
20.8.4 RecordCount Property
This read-only property returns the number of records in the PivotTable cache.
20.8.5 SourceData Property
This property returns the data source for the PivotTable, as we discussed in the section on the
PivotTable object.
20.8.6 Sql Property
This read-write string property returns or sets the SQL query string used with an ODBC data
20.9 The PivotItem Object
A PivotItem is a unique value of a PivotField. To illustrate, consider the following code:
Dim pi As PivotItem
For Each pi In _
ActiveSheet.PivotTables("Sales&Trans"). _
PivotFields("Store City").PivotItems
Debug.Print pi.Name
That code will print the list:
which contains the distinct Store City values from the Store City pivot field.
The PivotItems method of the PivotField object returns PivotItem objects. The syntax:
PivotFieldObject .PivotItems
returns the collection of all PivotItem objects for that PivotField. The syntax:
PivotFieldObject .PivotItems( Index )
Search JabSto ::

Custom Search