I am trying to create a number of small graphs on a single page and use data I have in an array. I have created 2 vectors as Series1 & Series2 (defined as Dim Series1(366) as double) and want to use as my data input. At the moment I write the data out to a worksheet and use the 'Range' (e.g."A3:A369") to create the series. The following code below works. I tried several alternatives with no success - examples
' With .SeriesCollection(1)'
' .Values = Series1
' End With
' ActiveChart.SeriesCollection(1).Add Source:=Series1
' ActiveChart.SeriesCollection.Add Source:=series2
If iChartObject = 5 Then
With ActiveSheet.ChartObjects.Add(Left:=1000, Width:=200, Top:=100, Height:=200)
.Chart.ChartType = my_charttype
.Chart.HasTitle = True
.Chart.ChartTitle.Text = ChartTitle
End With
End If
ActiveSheet.ChartObjects(iChartObject).Activate
ActiveChart.ChartArea.Select
str1 = Trim(str(lg_start))
str2 = Trim(str(lg_end))
str3 = "B" + str1 + ":B" + str2
str4 = ActiveSheet.Name
str5 = ActiveChart.Name
ActiveChart.SeriesCollection.Add Source:=ActiveSheet.Range(str3)
str3 = "C" + str1 + ":C" + str2
ActiveChart.SeriesCollection.Add Source:=ActiveSheet.Range(str3)
Any help appreciated
