Class ChartView (Excel VBA)

The class ChartView represents a view of a chart.


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

Dim chrvw as ChartView
Set chrvw = ActiveWindow.SheetViews(Index:=1)

For Each

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

Dim chrvwSheetView As ChartView
For Each chrvwSheetView In ActiveWindow.SheetViews
Next chrvwSheetView


Returns the sheet name for the specified ChartView object.

Dim strSheet As String
strSheet = ActiveWindow.SheetViews(1).Sheet


Returns the number of objects in the collection.

Dim lngCount As Long
lngCount = ActiveWindow.SheetViews.Count


Returns a SheetView object that represents views in a workbook.

Item (Index)

Index: Index value of the view.

Dim chrvwItem As ChartView
Set chrvwItem = ActiveWindow.SheetViews(Index:=1)