title: C# Open XML : We found a problem with some content. Newly added sheet doesn't show any data
body: <p>Below is the code iam using to <strong>ADD</strong> a new sheet into already existing spreadsheet.</p>
  
  <p>Iam passing a list&lt;T> in the input , this T has only 2 properties "code" and "description".
  I am looping through each of the T properties and putting them in sheetdata and finally saving the spreadhseet.</p>
  
  <pre><code>private static void PutInExcel(List&lt;RulesEngineOutput&gt; output)
      {
          using (SpreadsheetDocument document = SpreadsheetDocument.Open(@"C:\ATP\Sprints\PA\RE\IO.xlsx", true))
          {
  
  
              // Add a blank WorksheetPart.
              WorksheetPart newWorksheetPart = document.WorkbookPart.AddNewPart&lt;WorksheetPart&gt;();
              newWorksheetPart.Worksheet = new Worksheet(new SheetData());
  
              Sheets sheets = document.WorkbookPart.Workbook.GetFirstChild&lt;Sheets&gt;();
              string relationshipId = document.WorkbookPart.GetIdOfPart(newWorksheetPart);
  
              // Get a unique ID for the new worksheet.
              uint sheetId = 1;
              if (sheets.Elements&lt;Sheet&gt;().Count() &gt; 0)
              {
                  sheetId = sheets.Elements&lt;Sheet&gt;().Select(s =&gt; s.SheetId.Value).Max() + 1;
              }
  
              // Give the new worksheet a name.
              string sheetName = "NewRole" + sheetId;
  
              // Append the new worksheet and associate it with the workbook.
              Sheet sheet = new Sheet() { Id = relationshipId, SheetId = sheetId, Name = sheetName };
              sheets.Append(sheet);
  
              SheetData sheetData = newWorksheetPart.Worksheet.AppendChild(new SheetData());
              // Constructing header
              Row row = new Row();
  
              row.Append(
                  ConstructCell("Code", CellValues.String),
                  ConstructCell("Description", CellValues.String));
  
              // Insert the header row to the Sheet Data
              sheetData.AppendChild(row);
  
  
              foreach (var reItem in output)
              {
                  row = new Row();
  
                  row.Append(
                      ConstructCell(reItem.Code.ToString(), CellValues.Number),
                      ConstructCell(reItem.Description, CellValues.String)
                      );
  
                  sheetData.AppendChild(row);
              }
  
  
              newWorksheetPart.Worksheet.Save();
              document.WorkbookPart.Workbook.Save();
              document.Save();
  
          }
  
      }
  </code></pre>
  
  <p>The problem is everything happens  without error, i mean i can see the added worksheet in the debugging window, i am saving everything as well but when i open that spreadhseet, i see an error msg</p>
  
  <p><a href="https://i.stack.imgur.com/oJj6Y.jpg" rel="nofollow noreferrer">We found some problem with some content</a></p>
  
  <p>and finally the sheets show up without any content as below :</p>
  
  <p><a href="https://i.stack.imgur.com/DIKi7.png" rel="nofollow noreferrer">Blank sheet with sheetname</a></p>