Class CubeField (Excel VBA)

The class CubeField represents a hierarchy or measure field from an OLAP cube. In a PivotTable report, the CubeField object is a member of the CubeFields collection.

The classes PivotField and PivotFilter. give access to class CubeField

Member in collection


To use a CubeField class variable it first needs to be instantiated, for example

Dim cbf as CubeField
Set cbf = ActiveCell.PivotField.CubeField

The following procedures can be used to set variables of type CubeField: CubeFields.AddSet, CubeFields.GetMeasure, CubeFields.Item, PivotField.CubeField and PivotFilter.DataCubeField.

For Each

Here is an example of processing the CubeField items in a collection.

Dim cbf As CubeField
For Each cbf In ActiveCell.CubeFields
Next cbf

AddMemberPropertyField - Adds a member property field to the display for the cube field.

AutoGroup - Automatically groups the cube fields in an OLAP cube, optionally in the specified orientation and/or at the specified position.

ClearManualFilter - The ClearManualFilter method provides an easy way to set the Visible property to True for all items of a PivotField in PivotTables, and to empty the HiddenItemsList/VisibleItemsList collections in OLAP PivotTables.

CreatePivotFields - The CreatePivotFields method enables users to apply a filter to PivotFields not yet added to the PivotTable by creating the corresponding PivotField object.

Delete - Deletes the object.

CubeFields.AddSet - Adds a new CubeField object to the CubeFields collection. The CubeField object corresponds to a set defined on the Online Analytical Processing (OLAP) provider for the cube.

CubeFields.GetMeasure - Given an attribute hierarchy, returns an implicit measure for the given function that corresponds to this attribute. If an implicit measure does not exist, a new implicit measure is created and added to the CubeFields collection.


CubeFields.Item (Default member) - Returns a single object from a collection.

AllItemsVisible the AllItemsVisible property checks whether manual filtering is applied to a PivotField or CubeField.

Caption returns a String value that represents the label text for the cube field.

CubeFieldSubType specifies the type of a CubeField.

CubeFieldType indicates whether the OLAP cube field is a hierarchy field or a measure field. Can be one of the XlCubeFieldType constants.

CurrentPageName returns or sets the page name for a CubeField.

DragToColumn true if the specified field can be dragged to the column position. The default value is True.

DragToData true if the specified field can be dragged to the data position. The default value is True.

DragToHide true if the field can be hidden by being dragged off the PivotTable report. The default value is True.

DragToPage true if the field can be dragged to the page position. The default value is True.

DragToRow true if the field can be dragged to the row position. The default value is True.

EnableMultiplePageItems set to True to allow multiple items in the page field area for OLAP PivotTables to be selected. The default value is False.

FlattenHierarchies returns or sets whether items from all levels of hierarchies in a named set cube field are displayed in the same field of a PivotTable report based on an OLAP cube.

HasMemberProperties returns True when there are member properties specified to be displayed for the cube field.

HierarchizeDistinct returns or sets whether to order and remove duplicates when displaying the specified named set in a PivotTable report based on an OLAP cube.

IncludeNewItemsInFilter the IncludeNewItemsInFilter property is used to track included/excluded items in OLAP PivotTables.

IsDate returns True if the CubeField is a date.

LayoutForm returns or sets the way the specified PivotTable items appear—in table format or in outline format.

LayoutSubtotalLocation returns or sets the position of the PivotTable field subtotals in relation to (either above or below) the specified field.

Name returns a String value that represents the name of the object.

Orientation returns or sets an XlPivotFieldOrientation value that represents the location of the field in the specified PivotTable report.

PivotFields returns the PivotFields collection. This collection contains all PivotTable fields, including those that aren't currently visible on-screen.

Position returns or sets a Long value that represents the position of the hierarchy field on the PivotTable report when it's dragged from the field well.

ShowInFieldList when set to True (default), a CubeField object will be shown in the field list.

TreeviewControl returns the TreeviewControl object of the CubeField object, representing the cube manipulation control of an OLAP-based PivotTable report.

Value returns a String value that represents the name of the specified field.

CubeFields.Count returns a Long value that represents the number of objects in the collection.

PivotFields - A collection of all the PivotField objects in a PivotTable report.

TreeviewControl - Represents the hierarchical member-selection control of a cube field.