Foudn the following in the Office Automation Help file available from
http://www.greggriffiths.org/webdev/both/excel/
Code:
Sub CreateXLChart()
Dim xlApp As Excel.Application
Dim xlChrt As Excel.Chart
Dim TitleArray As Variant
Dim DataArray As Variant
TitleArray = Array("Dogs", "Cats", "Horses")
DataArray = Array(34, 53, 12)
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Add
With xlApp.ActiveSheet
.Range("A1:C1").Value = TitleArray
.Range("A2:C2").Value = DataArray
.Range("A1:C2").Select
End With
Set xlChrt = xlApp.ActiveWorkbook.Charts.Add()
With xlChrt
.Visible = True
.Type = xl3DColumn
.HasLegend = False
End With
Set xlChrt = Nothing
Set xlApp = Nothing
End Sub