How to retrieve data from access database(.accdb) into excel using vba
问题 I'm working on Excel VBA macros and I want to retrieve data from a MS Access database ( .accdb file). I've tried using below connection string and it throws runtime error '438' Dim cn As Object, rs As Object,DBFullName As String,Target As Range DBFullName = "D:\Tool_Database\Tool_Database.accdb" Set Target = Sheets("Sheet1").Range("A1") Set cn = CreateObject("ADODB.Connection") cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & DBFullName & ";" Set rs = CreateObject("ADODB.Recordset"