public static IEnumerable <Sheet> Sheets(this SpreadsheetDocument spreadsheet) { return(spreadsheet.Sheets(null).Select(p => new Sheet { OXmlSheet = p, WorkbookPart = spreadsheet.WorkbookPart, WorkSheetPart = spreadsheet.WorkSheet(p), Dimension = (spreadsheet.WorkSheet(p)).Worksheet.SheetDimension.Reference })); }
public static IEnumerable <Sheet> Sheets(this SpreadsheetDocument spreadsheet) { return(spreadsheet.Sheets(null).Select(p => new Sheet { OXmlSheet = p, WorkbookPart = spreadsheet.WorkbookPart, WorkSheetPart = spreadsheet.WorkSheet(p), Dimension = spreadsheet.WorkSheet(p) .RootElement.Descendants <DocumentFormat.OpenXml.Spreadsheet.SheetDimension>() .FirstOrDefault().Reference })); }