|
-
Dec 17th, 2008, 02:32 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Docmd.TranferSpreadSheet problem
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|