Sub Test2()
Dim DataTable As String, Req As String
Dim cnx As Object, rst As Object
With ThisWorkbook
DataTable = "[Feuil1$" & .Sheets("Feuil1").Range("A1").CurrentRegion.Address(0, 0) & "]"
Req = "SELECT * FROM " & DataTable & _
" WHERE [Colonne5] = '" & .Sheets("AdoDb").Range("E6") & "';"
Set cnx = CreateObject("Adodb.connection")
cnx.connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & .FullName & _
";Extended Properties=""Excel 12.0 Xml;HDR=YES"";"
Set rst = CreateObject("adodb.recordset")
cnx.Open
rst.cursorlocation = 3 'adUseClient ! IMPORTANT !
rst.Open Req, cnx
With .Sheets("AdoDb")
.Range("A10:BB10000").ClearContents
If rst.RecordCount <> 0 Then
For Champ = 1 To rst.Fields.Count
.Cells(10, 0 + Champ) = rst.Fields(Champ - 1).Name
Next Champ
.Range("A11").CopyFromRecordset rst
rst.Close
cnx.Close
End If
End With
Set rst = Nothing
Set cnx = Nothing
End With
End Sub