This project has moved. For the latest updates, please go here.

Foreach all sheets

Nov 27, 2012 at 9:39 AM


how I can walk throw all Sheets (not only worksheets)

I try something

Excel.Workbook wb = xl.ActiveWorkbook;
for (int i = 0; i < wb.Sheets.Count; i++) {                  
         if (wb.Sheets[i] is Excel.Worksheet ) {                       
             //type of worksheet
           if (wb.Sheets[i] is Excel.Chart ) {
               //type of chart
          if (wb.Sheets[i] is Excel.Dialog){
              //type of dialog

Thanks for answer