The active chart is a chart object. The parent of a chart object is the chart object collection. The parent of that is the sheet.
If you want to create a new chart:
Sub AddChartObject()
Dim myChtObj As ChartObject
'
Set myChtObj = ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=375, Top:=75, Height:=225)
myChtObj.Chart.SetSourceData Source:=Sheets("Sheet1").Range("A3:G14")
myChtObj.Chart.ChartType = xlXYScatterLines
End Sub
If you want to manipulate an existing chart
Sub SetChartAxisScale()
Dim ws As Worksheet
Dim myChtObj As ChartObject
Set ws = ThisWorkbook.Worksheets("ITF_Chart")
Set myChtObj = ws.ChartObjects("Chart 3")
With myChtObj.Chart.Axes(xlValue)
.MaximumScale = 44
End With
End Sub
Bookmarks