Difference between worksheets and tables in Excel interop

In excel COM interop (C #) what is the difference between:

_sheet = (Excel._Worksheet)_wb.Worksheets["SheetName"]; 

and

 _sheet = (Excel._Worksheet)_wb.Sheets["SheetName"]; 

?

+6
source share
1 answer

Sheets may contain other "Tables" than worksheets. Worksheets are not the only option. E. g. where there is a Sheets, which contains only diagrams, but no cells. Today they are little used. Thus, in order to save, it is best to use the Worksheets property, because this gives only worksheets with a documented format. If unsuccessful, the sheet may contain a sheet that is different from your expectations. I doubt that many โ€œnon-worksheetsโ€ remain in the wild, but you never know, and Microsoft can provide more options for the worksheets.

+9
source

All Articles