Excel Oledb import into Datatable Skips Last Row



I am using the standard Oledb Jet 4.0 provider to read an excel file
*** into a datatable.


The relevant portion of code looks like this (standard routine):

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FilePath & ";" & _
"Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
sQuery = "SELECT * " & _
"FROM [Sheet1$]"
myData = New OleDbDataAdapter(sQuery, strConn)
myData.Fill(gDsUsers)
gDtUsers = gDsUsers.Tables(0)



For some unknown reason the last row of data is skipped. If I have the
Excel file Open (in Excel) during the import, then the last row is
imported into the datatable successfully! But with the file closed no
such luck.


This is very strange behavior. I was hoping someone would have a
solution. I have tried several IMEX and HDR combinations etc. but none
seem to make a difference.

I have also seen this problem posted on other newsgroups but no one
has been able to solve the problem.

I am using ADO.NET 2.0 in a Windows Forms app.

.