c# - Date conversion issue with Excel Interop and CSV file -
i have csv file contains dates formatted m/dd/yyyy follows
1/06/2013,15,1,1/06/2013 0:15,1,6.44
when open file in excel, dates correctly converted - 1/06/2013 has numeric value 41,426.00 , month() function returns 6.
when use microsoft.office.interop.excel open same file using either open() or opentext() method date gets converted 41,280.00 (6/01/2013).
can open csv file using microsoft.office.interop.excel opens same if user opened file windows shell?
regards dave
found answer myself buried in bottom of question - excel vba date formats/values change when file opened programatically
workbook = workbooks.open(filename, local: true)
open() has local property, when false assumes mdy order ambiguous dates, when true uses local machine setting in australia dmy
Comments
Post a Comment