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
If you are adding a string to a cell rather than a number (or a string that can be converted to a number) then you should use an inline string or a shared string instead of the CellValue. You can only use CellValue if the value is numeric.
The XML generated when using CellValue looks something like:
12345
when you use an inline string it looks like:
Foo
note the "is" node for inline string and that the cell type attribute is set to "inlineStr".
Here is C# code to generate correct XML for a cell containing text:
cell.DataType = CellValues.InlineString;
cell.InlineString = new InlineString() { Text = new Text(textToInsert) };
From what I have read using shared strings is preferable but using inline strings avoids the error and looks just fine when you open the file in Excel.