is it possible to set a default culture setting for the excel sheet?
what is the best way to set the format to "mm-dd-yyyy" and only "mm-dd-yyyy" even if you work on a pc with american culture or any other one without lossing the cell format which should be Date.
Well, I have tested you issue but I am getting the date custom format “mm-dd-yyyy” fine with american culture set on my PC. I don’t think, setting the Column format is actually dependent on the PC culture. May be you are using some old version of Aspoe.Cells. Please try the attached latest version of Aspose.Cells and if you still face any problem, please share your template file + generated sheet and we will look into it.
Also, following is my sample code,
Sample Code:
//Instantiating an Workbook object
Workbook workbook = new Workbook();
workbook.Worksheets.Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet sheet = workbook.Worksheets[0];
sheet.Cells[0, 0].PutValue(DateTime.Now);
Style style2;
StyleFlag flag = new StyleFlag();
style2 = sheet.Cells.Columns[0].Style;
style2.Custom = "mm-dd-yyyy";
flag.NumberFormat = true;
sheet.Cells.Columns[0].ApplyStyle(style2, flag);
//Saving the Excel file
workbook.Save("C:\\test_format.xls");