I have a scenario while working with Microsoft Excel Interop.
System.Collections.IEnumerator wsEnumerator = excelApp.ActiveWorkbook.Worksheets.GetEnumerator();
while (wsEnumerator.MoveNext())
{
wsCurrent = (Excel.Worksheet)wsEnumerator.Current;
//Worksheet operation Follows
}
I am operating on Worksheets, so i can not have Chart in this. What i want to do achieve is operate on Sheets and check if it is a Worksheet or Chart, and act accordingly.
As sheets contain both Worksheet, Chart and "Excel 4.0 Macro", so what is the type of Sheets each entry as it can hold any of the type mentioned.
System.Collections.IEnumerator wsEnumerator = workBookIn.Sheets.GetEnumerator();
while (wsEnumerator.MoveNext())
{
//Identify if its a chart or worksheet
}