I'm working on VS2008 .NET3.5 with a Office 2003 doc (.xls). I'm using Microsoft.Office.Interop.Excel to access to a document.
This works fine for my purpose but fails whenever I try to get a Date.
The way I'm using is the most common:
object date= xlWorkSheet.get_Range("E" + i, "E" + i).Value2;
double doubleDate = double.Parse(date);
DateTime finallyDate = DateTime.FromOADate(doubleDate);
The date I have stored is 01/12/1961 (in Italian means first december and if I open excel it tolds me 1 december 1961).
When I run my app it happens that the value of the double become 15011.0 and when the finallyDate value is 2/4/1941 that's not right!
How can I solve this problem? Is there any way to convert (also manually) that 15011 number?
Thank you!!