The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This documentation is archived and is not being maintained.
Excel Developer Reference
Represents a hierarchy or measure field from an OLAP
cube. In a PivotTable report, the CubeField object is a member of the CubeFields collection.
Use the CubeField property to return the CubeField object. This example creates a list of the cube field names for all the hierarchy fields in the first OLAP-based PivotTable report on Sheet1.
Visual Basic for Applications
Set objNewSheet = Worksheets.Add
intRow = 1
For Each objPF in _
If objPF.CubeField.CubeFieldType = xlHierarchy Then
objNewSheet.Cells(intRow, 1).Value = objPF.Name
intRow = intRow + 1
is the cube field’s index number, to return a single CubeField object. The following example determines the name of the second cube field in the first PivotTable report on the active worksheet.