I\'m receiving an error when opening my OpenXML created spreadsheet. The error is as follows.
Repaired Records: Cell information from /xl/worksheets/sheet.xml p
Stumbled on this issue myself and found this thread. Difference in my case could not repair the file.
Issue was row index which I passed to InsertCellInWorksheet
taken from example on MSDN.
Cell cell = InsertCellInWorksheet("A", lastRow.RowIndex, worksheetPart);
When inserting a row, make sure the index of the row is 1, not 0. However, 0 for the SheetData
collection.
sheetData.InsertAt(new Row() { RowIndex = 1 }, 0);
lastRow = sheetData.Elements().LastOrDefault();
In hope to save someone time who goes through the same trouble.
Interestingly enough, my integration test passed, however, when opening the file via Excel, it was showing the pop-up about corruption. Seems there is a row with index 0, however, bit secretive as you will not be able to open a file with Excel.