danomaniac
Programmer
Hi gang.
I'm creating an app in VB6 that opens Excel, populates it with some data, then creates a chart from the data. I'm having trouble setting the SourceData Source for my chart object. The number of data entries varies so I can't set my source as an absolute reference.
I've used this and it works...
ActiveChart.SetSourceData Source:=Sheets("Results"
.Range("A14
25"
, PlotBy _
:=xlColumns
But I need to set the range using a variable. I've managed to figure out how to create a variable sized named range depending on how many lines will be populated, but I can't figure out how to make this work...
ActiveChart.SetSourceData Source:=Sheets("Results"
.Range("Range1"
, PlotBy _
:=xlColumns
Any help would be appreciated. Thanks.
I'm creating an app in VB6 that opens Excel, populates it with some data, then creates a chart from the data. I'm having trouble setting the SourceData Source for my chart object. The number of data entries varies so I can't set my source as an absolute reference.
I've used this and it works...
ActiveChart.SetSourceData Source:=Sheets("Results"



:=xlColumns
But I need to set the range using a variable. I've managed to figure out how to create a variable sized named range depending on how many lines will be populated, but I can't figure out how to make this work...
ActiveChart.SetSourceData Source:=Sheets("Results"


:=xlColumns
Any help would be appreciated. Thanks.