How do I read data from a spreadsheet using the OpenXML Format SDK?

The other answer seemed more like a meta-answer. I have been struggling with this since using LINQ does work with separated document parts. The following code includes a wrapper function to get the value from a Cell, resolving any possible string lookups. public void ExcelDocTest() { Debug.WriteLine(“Running through sheet.”); int rowsComplete = 0; using (SpreadsheetDocument … Read more

Cell styles in OpenXML spreadsheet (SpreadsheetML)

Right, I managed to figure this out, after a lot of experimentation. It turns out that excel reserves styles 0 and 1 for normal cells and “Gray125” pattern fill respectively. Most of the above code can be removed, as we only need a CellFormat really. Working code: Console.WriteLine(“Creating document”); using (var spreadsheet = SpreadsheetDocument.Create(“output.xlsx”, SpreadsheetDocumentType.Workbook)) … Read more