I am Using VBA and Iam trying to import the table from Excel to Access this code
ID: 3925311 • Letter: I
Question
I am Using VBA and Iam trying to import the table from Excel to Access this code is not working can you help me with it please aand make it work!!!
Sub AddData()
Dim cn As ADODB.Connection
Dim Sheet1 As String
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Project1_Faris.xlsm;Extended Properties=Excel 8.0;" _
& "Persist Security Info=False"
' Append data from Sheet1 of workbook to Table1 of mydb.mdb:
cn.Execute "INSERT INTO Table1([Thrillseekers]) IN 'C:UsersDannyDesktopProject_1Database11.mdb' SELECT mytable1.Thrillseekers FROM myTable1"
cn.Close
Set cn = Nothing
End Sub
Explanation / Answer
strFile = Dir()
Loop
End Functon
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.