R
ryu
I am writing the VBA code in Excel to copy the Excel data to a table i
Access database. I am using the function DoCmd.TransferSpreadsheet to d
the job but I keep getting the "Compiled Error: Variable not Defined
error message whenever I run the code. I am not sure what I am doin
wrong. Please help!!
Here is my code.
Sub CopyToAccessTable()
Dim oApp As Object
Dim LPath As String
LPath = "C:\Work\test.mdb"
Set oApp = CreateObject("Access.Application")
oApp.OpenCurrentDatabase LPath
oApp.DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9
"Additional_Accounts", "C:\Work\test.xls", True
End Sub
Thank you so much for your hel
Access database. I am using the function DoCmd.TransferSpreadsheet to d
the job but I keep getting the "Compiled Error: Variable not Defined
error message whenever I run the code. I am not sure what I am doin
wrong. Please help!!
Here is my code.
Sub CopyToAccessTable()
Dim oApp As Object
Dim LPath As String
LPath = "C:\Work\test.mdb"
Set oApp = CreateObject("Access.Application")
oApp.OpenCurrentDatabase LPath
oApp.DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9
"Additional_Accounts", "C:\Work\test.xls", True
End Sub
Thank you so much for your hel