365
Referencing Charts and Chart Objects in VBA Code
Set WS = Worksheets(“Sheet1”)
‘ Create a chart on a new sheet
Charts.Add
‘ This technique is from chapter 13
‘ of the Excel Charting book
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=WS.Range(“A1:B4”)
ActiveChart.Interior.ColorIndex = 4 ‘ Green
End Sub
Coding for New Charting Features in Excel 2007
Charts have been completely rewritten in Excel 2007. Most code from Excel 2003 will
continue to work in Excel 2007. However, if you write code to take advantage of the new
charting features, that code will not be backward compatible with Excel 2003.
The following are some of the ...