Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why won't my code for importing an Excel file work??

Status
Not open for further replies.

paychexanalyst

Technical User
Oct 6, 2009
2
US
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblSalesProspects", "\\corpnt02\ens_sh\Financial Risk Management\Risk Analysis\Equifax Automation Project\DSRLDS.xls", True, ""


I've tried using different versions of Excel (i.e. acSpreadsheetTypeExcel8). Nothing seems to be working. The excel file has Field Names already, it seems like this should be straight forward. If someone could let me know I would reall appreciate it!!

Thanks in advance.
 
First thing is to remove the

, ""

at the end. If you aren't supplying a range, don't even put it there. You don't supply an argument for that if you don't have one to supply.

Bob Larson
Free Access Tutorials and Samples:
 
This works for me

DoCmd.TransferSpreadsheet acImport, 8, "tblTABLE_NAME","C:\Untitled\MyFile.xls", True





------------------------------------------------------------------------------
Ambition..........If you dont use it, you wont lose it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top