title: Repaired Records : Cell information from worksheet created from scratch
body: <p>I'm receiving an error when opening my OpenXML created spreadsheet.  The error is as follows.</p>
  
  <pre><code>Repaired Records: Cell information from /xl/worksheets/sheet.xml part
  Repaired Records: Cell information from /xl/worksheets/sheet2.xml part
  Repaired Records: Cell information from /xl/worksheets/sheet3.xml part
  </code></pre>
  
  <p>The only thing I could find online that was helpful was this issue was the discussion of an algorithm which alters an individual cell multiple times causing the issue. Having said that, I'm going to link my Constructor for the SpreadsheetDocument as well as the three functions for updating a cell (which I do once).</p>
  
  <p>I can supply any additional functions as needed, but I believe the problem is somewhere in the two listed below. </p>
  
  <p>By the way,</p>
  
  <pre><code> GetWorksheetPartByName
   InsertCellInWorksheet
   GetCell
  </code></pre>
  
  <p>should all working as intended.</p>
  
  <p><strong>The Actual Program</strong></p>
  
  <pre><code>static void Main(string[] args)
      {
          //Full path for File
          const string newFile = "@C:\test.xlsx";
  
          //Constructor creates default worksheet called "mySheet"
          var spreadsheet = new XLSXHelper(newFile);
  
          //updating some cells.
          spreadsheet.UpdateCell("mySheet", "D2", "R", 2);
      }
  </code></pre>
  
  <p><strong>Constructor</strong></p>
  
  <pre><code>    public XLSXHelper(string filepath)
      {
          newFile = filepath;
          spreadsheetDocument = SpreadsheetDocument.Create(filepath, SpreadsheetDocumentType.Workbook);
          this.workbookPart = spreadsheetDocument.AddWorkbookPart();
          workbookPart.Workbook = new Workbook();
          this.worksheetPart = workbookPart.AddNewPart&lt;WorksheetPart&gt;();
          worksheetPart.Worksheet = new Worksheet(new SheetData());
          Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.
          AppendChild&lt;Sheets&gt;(new Sheets());
          Sheet sheet = new Sheet()
          {
              Id = spreadsheetDocument.WorkbookPart.
                  GetIdOfPart(worksheetPart),
              SheetId = 1,
              Name = "mySheet"
          };
          sheets.Append(sheet);
          workbookPart.Workbook.Save();
          spreadsheetDocument.Close();
      }
  </code></pre>
  
  <p><strong>Update Cell</strong></p>
  
  <pre><code>    public void UpdateCell(string worksheetName, string textToInsert, string columnName, uint rowIndex)
      {
          using (SpreadsheetDocument spreadSheet = SpreadsheetDocument.Open(newFile, true))
          {
              WorksheetPart worksheetPart = GetWorksheetPartByName(spreadSheet, worksheetName);
              if (worksheetPart != null)
              {
                  InsertCellInWorksheet(columnName, rowIndex, worksheetPart);
                  Cell cell = GetCell(worksheetPart.Worksheet,columnName, rowIndex);
                  cell.CellValue = new CellValue(textToInsert);
                  worksheetPart.Worksheet.Save();
              }
          }
      }
  </code></pre>