title: DBF (dBase) file - open and convert in Excel VBA
body: <p>I have problem as I'm trying to read a dbf file to my VBA macro, go through it, process the data and put in choosen worksheet. I am stuck, because I am getting 3001 error (arguments of wrong type, out of range or in conflict)</p>
  
  <p>This is my code, what could be wrong about it?</p>
  
  <pre><code>FileToOpen = Application.GetOpenFilename _
  (Title:="Please choose a file to import", _
  FileFilter:="Excel Files *.dbf (*.dbf),")
  ''
  If FileToOpen = False Then
  MsgBox "Plik nie został wybrany.", vbExclamation, "Błąd!"
  Exit Sub
  Else
     Dim conn As Object
     Set conn = CreateObject("ADODB.Connection")
     Dim rst As Object
     Set rst = CreateObject("ADODB.Recordset")
     iPos = InStrRev(FileToOpen, "\", , vbTextCompare)
     Filepath = Left(FileToOpen, iPos)
     Filename = Right(FileToOpen, iPos - 1)
     MsgBox Filename &amp; " " &amp; Filepath
     conn.Open "DRIVER={Microsoft dBase Driver (*.dbf)};" &amp; "DBQ=" &amp; Filepath
     Debug.Print conn.ConnectionString
     rst.Open "Select * From " &amp; Filename, conn, adOpenStatic, adLockReadOnly, adCmdText
  Do Until rst.EOF
     Debug.Print rst.Fields(1).Value
     rst.MoveNext
  Loop
      rst.Close
      Set rst = Nothing
      conn.Close
      Set conn = Nothing
  End If
  </code></pre>
  
  <p>I also checked a file format and it's "File without DBT" whatever it means, still don't know the format of it :> Maybe I should change Driver ID?</p>