title: Created Excel file using OpenXML needs repair when opened in Excel
body: <p>I am trying to insert Excel file (.xlsx)  cell using C# openXML, </p>
  
  <p>but when I open the created Excel file it is need to be repaired by showing following error,</p>
  
  <blockquote>
    <p>Repaired Records: Cell information from /xl/worksheets/sheet1.xml part</p>
  </blockquote>
  
  <p>Here is my code. </p>
  
  <pre><code>    public void InsertText(TestModelList data)
      {
          var date_time = DateTime.Now.ToString().Replace("/", "_").Replace(":", "_");
          string OutputFileDirectory = "E:\\TEST";
          string fileFullName = Path.Combine(OutputFileDirectory, "Output.xlsx");
          if (File.Exists(fileFullName))
          {
              fileFullName = Path.Combine(OutputFileDirectory, "Output_" + date_time + ".xlsx");
          }
  
          using (SpreadsheetDocument spreadSheet = SpreadsheetDocument.Create(fileFullName, SpreadsheetDocumentType.Workbook))
          {
              WorkbookPart wbp = spreadSheet.AddWorkbookPart();
              WorksheetPart wsp = wbp.AddNewPart&lt;WorksheetPart&gt;();
              Workbook wb = new Workbook();
              Worksheet ws = new Worksheet();
              SheetData sd = new SheetData();
              InsertToCell(1, "C", "1C", sd);
              ws.Append(sd);
              wsp.Worksheet = ws;
              wsp.Worksheet.Save();
              Sheets sheets = new Sheets();
              Sheet sheet = new Sheet()
              {
                  Id = wbp.GetIdOfPart(wsp),
                  Name  = "test",
                  SheetId = 1
              };
  
              sheets.Append(sheet);
              wb.Append(sheets);
              spreadSheet.WorkbookPart.Workbook = wb;
              spreadSheet.WorkbookPart.Workbook.Save();
          }
      }
  
      private void InsertToCell(uint rowIndex, string col, string value, SheetData sd)
      {
          var row = new Row() { RowIndex = rowIndex };
  
          var cellReference = col + rowIndex;
  
          Cell newCell = new Cell
          {
              StyleIndex = (UInt32Value)1U,
              CellValue = new CellValue(value),
              DataType = CellValues.SharedString,
              CellReference = cellReference
          };
          row.InsertBefore(newCell, null);
          sd.Append(row);
      }
  </code></pre>
  
  <p>Can anyone please help me to fix this issue?</p>