3

I'm trying to display date in the format dd/MM/yyyy in an excel file with the Spreadsheet Gear library, but the system and office looks like running an english localization.

I've already try to use the Cell.NumberFormat property and directly setting the DateTime object to the Cell.Value property, without success...

Do you have any idea on how to control the excel formating of a DateTime ?

Grtz

Emmanuel Istace
  • 1,209
  • 2
  • 14
  • 32

1 Answers1

4

Ok, just found a solution.

When I create the WorkbookSet object, I can specify the CultureInfo (which can't be set after).

Example:

SpreadsheetGear.Factory.GetWorkbookSet(CultureInfo.CurrentCulture);
Ciaran Gallagher
  • 3,895
  • 9
  • 53
  • 97
Emmanuel Istace
  • 1,209
  • 2
  • 14
  • 32
  • Excellent! Yes, the system's locale generally is how Excel interprets date-like values, and this is a problem when transferring data between locales. You can change this at the Workbook level (when opening the workbook it's an optional argument in Excel) or at the system level. Cheers! – David Zemens Apr 09 '13 at 13:43