property Columns.Count as Long
Returns the number of objects in a collection.

TypeDescription
Long A Long expression that specifies the number of data columns
The Count property specifies the number of data columns. The ClearData method clears the control's data. The PivotColumnsFloatBarVisible property specifies whether the Columns collection is displayed to a floating bar, so user can drag and drop columns to the control's pivot bar so it gets data summarized. You can use the for each statement to enumerate the data columns in the control. The Item property gets the Column object based on its index or caption.

The following VB sample enumerates the data columns:

With Pivot1
    Dim c As EXPIVOTLibCtl.Column
    For Each c In .DataColumns
        Debug.Print c.Caption
    Next
End With