Nseries add throwing exception

Hi,


I am getting exception “Index was out of range. Must be non-negative and less than the size of the collection.” while trying to add DataSeries for charts.

int nSeriesIndex = toDrawchart.NSeries.Add(charts.RangeArea, true);

The range areas is “__object0x3acounter!B2:B9”,

What can be the possible reasons of getting this error?

Regards,
Kallol

Hi,


Well, the exception has many scenarios, so we cannot predict, may be you are not referring to valid source range of cells area for the data series of chart, etc. I am afraid, we need your sample code (runnable) with your template file(s), preferably a sample console application (you may zip it prior attaching here) to reproduce the issue on our end, we will check it soon.

Thank you.