Hi There,
I have a routine which imports a custom type to an excel worksheet. For one of my custom types, the dateformat I am after, in this case 'yyyy-mm-dd' is being applied successfully. For another it's not and I can't figure out why.
The actual value for the dates is being imported to the worksheet as I'd expect '40299' for example, but the formatting isn't being applied, it stays as 'General'.
I've even tried explicitly setting the style for the column in question, but this doesn't seem to solve the problem either!
Can anyone point me to anything which may impact the style of my workbooks date columns? At the moment my code is pretty straight forward, see below:
mySheet.Cells.ImportCustomObjects(
(System.Collections.ICollection)myDataList,
GetPropertiesList(typeof(myType)),
true,
0,
0,
myDataList.Count,
true,
"yyyy-mm-dd",
false
);
Just for reference, the 'GetPropertiesList' function simply returns a string array for the properties in the type I'm exporting, and myDataList is simply a List<> of that type.
I can confirm that in the List<> the property in question is being rendered as a datetime.
Any ideas?
Cheers,
Doug