Read EXCEL File
Posted on 2012-03-22
Reading EXCEL Files
Occasionally I receive a file that was created in some software packages where I can’t see either the first or last column using the code below.
If I open the file in excel and save the file then the missing column is displayed.
I’ve tried referencing
Reference Microsoft ActiveX Data Obect 2.6 Libary
Reference Microsoft ActiveX Data Obect 2.7 Library
Reference Microsoft ActiveX Data Obect 2.8 Library
With no difference
The attachmet is the Sub that reades the Excel File and writes the contents to a Tab Delimited File.
I suspect the problem may be in open syntex ( see below )
Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sExcelFileName & ";" & _
"Extended Properties=""Excel 8.0;HDR=YES;"""
Any help will be appreciated.