We have an issue with DateTime :
We store a DateTime in a cell and set the format "m/d/yyyy".
Spire is in Invariant culture and Excel is in French culture.
When we open Excel workbook, the cell is in Personalize format.
We need the predifined format (in the date tab)
How to give that ?
- Code: Select all
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
var workbook = new Workbook();
var worksheet = workbook.Worksheets.First();
worksheet.Range["B2"].Value2 = new DateTime(2017, 01, 30);
worksheet.Range["B2"].NumberFormat = "m/d/yyyy";
workbook.SaveToFile(Chemin + "Sample - Out.xlsx", ExcelVersion.Version2016);
Best regards.
Vincent