rahavtom Posted April 22, 2005 Posted April 22, 2005 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 // Here's 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. Quote
mark007 Posted May 4, 2005 Posted May 4, 2005 What is type for DataSource and what is the type of Spreadsheet1? You need to make sure that they are compatible. Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
herilane Posted May 4, 2005 Posted May 4, 2005 Have a look at this KB article: http://support.microsoft.com/?kbid=319398 Quote
Recommended Posts