Hi,

I am trying to import an Excel file into Access, I have followed all the forums and blogs, but nothing happens, it hangs on the DoCmd line..
What am I missing???

Thanks

Private Sub ImportXLSheets()
On Error GoTo ERROR

Dim WrksheetName As String
Dim FileName As String

FileName = "C:\temp\test.xls"


Dim xl As Object
Set xl = CreateObject("Excel.Application")

xl.Visible = falsexl.Workbooks.Open FileName

DoCmd.TransferSpreadsheet (acImport), acSpreadsheetTypeExcel9, "tbl_In_DB", FileName, True



MsgBox "done"
Set xl = Nothing
End Sub