Class ChartCategory (PowerPoint VBA)

The class ChartCategory represents all chart categories in the document, whether visible (unfiltered) or not.

Set

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

Dim chrc as ChartCategory
Set chrc = ActiveWindow.RangeFromPoint.Chart.ChartGroups(1).CategoryCollection(Index:=1)

The following procedures can be used to set variables of type ChartCategory: ChartGroup.CategoryCollection and CategoryCollection.Item

CategoryCollection.Count

Returns a Long that represents the number of categories in the collection.

Dim lngCount As Long
lngCount = ActiveWindow.RangeFromPoint.Chart.ChartGroups(1).CategoryCollection.Count

CategoryCollection.Item

Returns an individual chart category.

Syntax : expression.Item (Index)

Index: The name or index number for the object.

Dim chrcCategoryCollection As ChartCategory
Set chrcCategoryCollection = ActiveWindow.RangeFromPoint.Chart.ChartGroups(1).CategoryCollection(Index:=1)

CategoryCollection.Parent

Returns the parent for the specified object. Read-only object.

IsFiltered

Returns or sets a Boolean that determines whether the specified chart category is filtered out from the chart.

ActiveWindow.RangeFromPoint.Chart.ChartGroups(1).CategoryCollection(1).IsFiltered = True

Name

Returns or sets a String that represents the name of a chart category.

Dim strName As String
strName = ActiveWindow.RangeFromPoint.Chart.ChartGroups(1).CategoryCollection(1).Name

Parent

Returns the parent for the specified object. Read-only object.