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