Second column of your excel file has a date format (12/2/1999
). This format is not recognized by NPOI in your current culture ("ru-RU"). This seems like a bug in NPOI, becuase when this happens, there is no way to read anything from that cell. The only way I came to, is to change the thread's culture before reading the excel file (and change it back after):
private DataTable xlsxToDT(string fileName)
{
var prevCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
try
{
// Put your whole method body here.
}
finally
{
Thread.CurrentThread.CurrentCulture = prevCulture;
}
}