I am evaluating Aspose.CeIls and having some issues setting date formats as follows:
I am trying to display the date as ‘mmm-yy’, for example Dec-14.
This works fine when using a DateTime:
ws.Cells["A1"].PutValue(DateTime.Now); Style style = ws.Cells["A1"].GetStyle(); style.Number = 17; ws.Cells["A1"].SetStyle(style);
However I need to use strings as follows:
ws.Cells["A2"].PutValue("10/11/2014"); Style style_2 = ws.Cells["A2"].GetStyle(); style_2.Number = 17; ws.Cells["A2"].SetStyle(style_2);
The above method produces a date in Excel as “10/11/2014” even though the properties of the cell correctly show the format of ‘mmm-yy’. If I double click the cell then the value appears in the correct format.
Any idea how to make this work with date strings?