When I add a chart in VB.NET into an excel sheet I get an error.
The error appears when I put a range like this into the source date:
"A1, A3, A5, A7".

If I add the same range into the source range of the chart there's no problem at all....

I recorded it and the macro gives the range. But when I paste the range into the VB.NET code I get an error HRESULT and a hex code.

ExcelApp.ActiveChart.SetSourceData(CType(Werkbook.Worksheets("Controle rapport"), Excel.Worksheet).Range("A1, A3, A5, A7"), 2)

There is no problem with this:

ExcelApp.ActiveChart.SetSourceData(CType(Werkbook.Worksheets("Controle rapport"), Excel.Worksheet).Range("A1:A7"), 2)

Anyone encountered this problem before?