Class ChartCategory (PowerPoint VBA)

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


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


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

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


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)


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


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


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


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