Hi,
In Excel, if you put a date as a string into a Cell using VBA as such:
ActiveCell.Value = "07/14/14"
or
ActiveCell.Value2 = "07/14/14"
The cell automatically gets formatted as a Date and you see:
“14/07/2014” (if your region is outside of the US).
In Aspose the same thing does not seem to work:
var workbook = new Workbook();
Worksheet ws = workbook.Worksheets[0];
ws.Cells[“A1”].PutValue( “07/14/14”, true);
ws.Cells[“A2”].PutValue( “07/14/14”, false);
workbook.Save(“Date.xlsx”);
A1 ends up being “41834” (formatted as General instead of Date).
And A2 is, as expected, simply the string “07/14/14”.
The same is true when using ImportTwoDimensionArray:
var array = new[,] { { “07/14/14”} };
var workbook = new Workbook();
Worksheet ws = workbook.Worksheets[0];
ws.Cells.ImportTwoDimensionArray(array, 0, 0, true);
workbook.Save(“Date2.xlsx”);
Best regards,