I'm creating a workbook in Excel using Open XML, which works fine - except dates. Working in Excel you can change a cell's datatype like this: Right click the cell, format cell, in the number tab choose "date" (from the category section). I'd like to accomplish the same thing using C# and Open XML to create the workbook, however my date cells are shown as "general" (text) in Excel.
The date format is OK, it's presented like this: 01.01.2015
. What I need is the cell type to be set to Date, so that I can filter by "January", not the string "01.01.2015"
.
When saving my Excel sheet as an .xml, I find that the cell is stored like this:
<Cell><Data ss:Type="String">04.09.2015 22:00:41</Data></Cell>
What I need is this:
<Cell ss:StyleID="s62"><Data ss:Type="String">04.09.2015 22:00:41</Data></Cell>
The bottom row is from a cell where I manually manipulated the data type to a Date.
I've used the examples where you create your own styles, the cell type is still a string when opened in Excel.