title: Minimal style sheet for Excel Open XML with dates?
body: <p>I'm trying to create an Excel file using the Open XML SDK with the minimal style sheet needed that will allow me to format a cell as a date. Below is my attempt at a style sheet:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;x:styleSheet xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"&gt;
      &lt;x:cellXfs count="1"&gt;
          &lt;x:xf numFmtId="14" xfId="0" applyNumberFormat="1" /&gt;
      &lt;/x:cellXfs&gt;
  &lt;/x:styleSheet&gt;
  </code></pre>
  
  <p>Even without referencing this style from a cell, Excel tells me that my file is corrupt. If I remove the cellXfs element, the file opens fine. Can someone explain what else I need to add to this? The C# code that creates the style sheet is below.</p>
  
  <pre><code>var stylesheet = new Stylesheet();
  var cellFormats = new CellFormats() { Count = 1 };
  var cellFormat = new CellFormat();
  cellFormat.NumberFormatId = 14;
  cellFormat.FormatId = 0;
  cellFormat.ApplyNumberFormat = BooleanValue.FromBoolean(true);
  cellFormats.Append(cellFormat);
  stylesheet.Append(cellFormats);
  </code></pre>
  
  <p>I've tried adding in cell style formats and cell styles, but just having the above seems to break the document and I'm unsure why.</p>