Good day to all! I try to implement reading data from Excel using SAX using this example. The problem is that this code does not output anything:

static void ReadExcelFileSAX(string fileName) { using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(fileName, false)) { WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart; WorksheetPart worksheetPart = workbookPart.WorksheetParts.First(); OpenXmlReader reader = OpenXmlReader.Create(worksheetPart); string text; while (reader.Read()) { if (reader.ElementType == typeof(CellValue)) { text = reader.GetText(); Console.Write(text + " "); } } Console.WriteLine(); Console.ReadKey(); } } 

The code goes into a loop, but the condition does not fail, I don’t know what the problem may be with the DOM method either, it’s all everywhere on the Internet, everything works perfectly and smoothly and as always =). Who worked with this library please tell me! Here is the file I'm trying to read.

  • And you can throw off the source file? - Vladislav Khapin

0