Class ChartView (Excel VBA)

The class ChartView represents a view of a chart.

Item

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

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

The following procedures can be used to set variables of type ChartView: SheetViews.Item and SheetViews.Item.

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

Sheet

Returns the sheet name for the specified ChartView object.

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

SheetViews.Count

Returns the number of objects in the collection.

Dim lngCount As Long
lngCount = ActiveWindow.SheetViews.Count

SheetViews.Item

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)