Dear All!
I use Visual Basic .NET 2003 and want to produce graphs by using Office Chart 11.0.
I would like to provide this chart with data from an Office Spreadsheet 11.0 and I use the following code I have found:
...
ChartSpace1.Clear()
ChartSpace1.Charts.Add()
Dim c = ChartSpace1.Constants
ChartSpace1.DataSource = Spreadsheet1 // Heres the problem
ChartSpace1.Charts(0).SeriesCollection.Add()
....
When I run this code, I get an error message saying that the specified cast is invalid, reffering to the line I marked (Datasource).
Does anyone know what what can be done to fix it?
Thanks!
Tom.
I use Visual Basic .NET 2003 and want to produce graphs by using Office Chart 11.0.
I would like to provide this chart with data from an Office Spreadsheet 11.0 and I use the following code I have found:
...
ChartSpace1.Clear()
ChartSpace1.Charts.Add()
Dim c = ChartSpace1.Constants
ChartSpace1.DataSource = Spreadsheet1 // Heres the problem
ChartSpace1.Charts(0).SeriesCollection.Add()
....
When I run this code, I get an error message saying that the specified cast is invalid, reffering to the line I marked (Datasource).
Does anyone know what what can be done to fix it?
Thanks!
Tom.