paulyoder / LinqToExcel

Use LINQ to retrieve data from spreadsheets and csv files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not a legal OleAut date

sameerkattel opened this issue · comments

When I am trying to parse an excel file getting exception Not a legal OleAut date exception.

System.ArgumentException occurred
  HResult=-2147024809
  Message=Not a legal OleAut date.
  Source=mscorlib
  StackTrace:
       at System.DateTime.DoubleDateToTicks(Double value)
  InnerException: 

How do you force a column to be treated as a string type rather than date type?

Right now, because of the way Excel handles dates, you would have to open the file in Excel, and change the format of the column to "text" or "general".