Paul your ADO Solution is great thanks!

Paul Clement Wrote:

A .csv file is generally a text file even though Excel can import them. You
can verify whether
it's
a text file by attempting to open the file in Wordpad or Notepad. The Excel
application is
associated with files that have .csv extension and that is why you see an
Excel icon.

If would try using ADO. You should be able to read the data into an ADO Recordset.
Below is
an
example that treats the file as a text file:


Sub ADOOpenTextDatabase()

Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "D:\My Documents\TextFiles;" & _
"Extended Properties=""Text;HDR=NO"""

rs.Open "Select * from TestCSV.csv", cnn, adOpenStatic, adLockPessimistic

While Not rs.EOF

Debug.Print rs.Fields(0).Value
Debug.Print rs.Fields(1).Value
rs.MoveNext

Wend

Debug.Print rs.RecordCount

rs.Close
cnn.Close

End Sub

The HDR argument indicates whether the first line in the file contains the
field names. If the
first
line contains the field names then change the value of this argument to YES.

You can also strictly define a structure text or csv file using a schema.ini
file:

http://msdn.microsoft.com/library/de...a_ini_file.asp


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)