static void ReadSheet(Spreadsheet document, Package.SpreadsheetDocument importDocument, Excel.Sheet importSheet, Dictionary <string, string> sharedStringTable, Dictionary <int, CellFormat> cellFormats) { Sheet sheet = document.Sheets.Sheet(importSheet.Name); var importWorksheet = new Excel.Worksheet(); importWorksheet.Load((Package.WorksheetPart)importDocument.WorkbookPart.GetPartById(importSheet.Id)); var sheetData = (Excel.SheetData)importWorksheet.Elements <Excel.SheetData>().First(); foreach (var importColumn in sheetData.Elements <Excel.Column>()) { ReadColumn(); } foreach (var importRow in sheetData.Elements <Excel.Row>()) { ReadRow(sheet, importRow, sharedStringTable, cellFormats); } }