View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope
 
Posts: n/a
Default Setting Excel chart series from vb6

Hi,

Do the range references contain data. Empty cells can sometimes cause
problems when trying to set range references.

Cheers
Andy

Jim via OfficeKB.com wrote:
Anyone :(

Jim wrote:

hi,
I currently have a line chart which series is setup in vb6.

I have a undefined amount of values exporting into excel, so i need to set my
chart series from vb to account for the undefinded amount of values. I have
upto 3 series per chart already made awaiting for the vb series data.

the problem is that excel will only let me alter series 1 and i need it to do
3, and sometimes excel will give an error saying "unable to set series data".

this is what i have so far.
x& = no. of lines of data

Set xlSheet = xlBook.Worksheets("Temperate Chart")
xlSheet.ChartObjects(1).Chart.SeriesCollection(1). XValues =
Worksheets("Data").Range("A10:A" & x&) '"Data!$A$10:$A$" & x&
'xlSheet.ChartObjects(1).Chart.SeriesCollection(1) .Values =
Worksheets("Data").Range("C10:C" & x&)
'xlSheet.ChartObjects(1).Chart.SeriesCollection(2) .Values =
Worksheets("Data").Range("G10:G" & x&)
'xlSheet.ChartObjects(1).Chart.SeriesCollection(3) .Values =
Worksheets("Data").Range("K10:K" & x&)

Please help.




--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info