O has already been set up as a excel.application
I keep getting errors with this...
I created it in the macro of Excel but need it to work in VB
O.Charts.Add
O.ActiveChart.ChartType = xlLine <-ERROR
O.ActiveChart.SetSourceData Source:=O.Sheets("MarketSmart").Range("F1:G" & MScr), PlotBy:=xlColumns
O.ActiveChart.Location here:=xlLocationAsNewSheet, Name:="MS Chart" <-ERROR
With O.ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "MarketSmart"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Defects"
End With
O.ActiveChart.HasDataTable = False
HELP!!!!!!




Reply With Quote