das folgende VBA, das ich in diesem Forum gefunden haben funktioniert bestens.
Leider wir die die Titelzeile aus Access NICHT mitimportiert.
Hat jemand eine Idee
Danke für eine Hilfe
Maria
Function Import_Access_to_Excel()
' Datenimport aus Access
Dim oRS As Object, oConn As Object
Dim sSql As String, strCon As String
Dim iCount As Integer, strAccessFile As String
strAccessFile = "D:\TPSC\01_ACCESS_und_Listen\TPSC_MITG_2020.accdb"
sSql = "SELECT * FROM abfr_4000_mitgl_liste"
Set oConn = CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strAccessFile & ";"
oConn.Open strCon
Set oRS = oConn.Execute(sSql)
Sheets("Test").Cells.Clear ' Tabellen CLEAREN
iCount = Sheets("Test").Range("A1").CopyFromRecordset(oRS)
oRS.Close
oConn.Close
Set oRS = Nothing
Set oConn = Nothing
End Function