Tuesday, December 11, 2012 3:03 PM
why the following line in C#
Excel.Series mySeries = (Excel.Series)myChart.SeriesCollection(1);
throws the following exception
Exception Type: System.InvalidCastException
What is the correct call in C# to get the series of a chart ?
If I try this way:
Excel.Series mySeries = (Excel.Series)myChart.SeriesCollection.Item(1);
I get the following compile error :
error CS0119: 'Microsoft.Office.Interop.PowerPoint.Chart.SeriesCollection(object)'
is a 'method', which is not valid in the given context
Wednesday, December 12, 2012 11:20 AMModerator
Thank you for posting in the MSDN Forum.
What is the correct call in C# to get the series of a chart
The first expression is correct, but you cannot cast PowerPoint.Series value to Excel.Series.
Hope it helps.
Quist Zhang [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked As Answer by HeinrichMS Wednesday, December 12, 2012 10:33 PM