title: Office Open XMl SDK Writing Numbers to Sheet
body: <p>I am trying wo write Numbers from a DataTable to an Datasheet - unfortunately, this does not work as expected, e. g. the DataSheet is corrupted.</p>
  
  <p>I am using the following code:</p>
  
  <pre><code>    private void AddDataToSheet(ExcelViewData data, SheetData sheetData)
              {
                  var excelData = data.WriteableDataTable; 
  //// this returns a datatable
  ////the numbers have a format like "8,1" "8,0" etc.
                  for (int i = 0; i &lt; excelData.Rows.Count; i++)
                  {
                      Row row = new Row();
                      //row.RowIndex = (UInt32)i;
                      for (int c = 0; c &lt; excelData.Columns.Count; c++)
                      {
                          Cell cell = new Cell();
                          CellValue cellvalue = new CellValue();
                          //cell.CellReference = SharedMethods.GetExcelColumnName(i + 1) + (c + 1).ToString();
                          cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.Number;
                          cellvalue.Text = excelData.Rows[i][c].ToString().Replace(",",".");
                          cell.Append(cellvalue);
                          row.Append(cell);
                      }
  
                      sheetData.Append(row);
                  }
              }
  </code></pre>
  
  <p>Any Idea why this fails? I have seem multiple tutorials with the same approach.</p>