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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with TransferSpreadsheet

Status
Not open for further replies.

dabruins

Programmer
Mar 9, 2005
102
CA
I am attempting to import a csv file into my access database. I've set up the code as follows but upon running it I get a 3011 error noting that it could not find the object....blah blah blah.

pth = Me!txtfilepathimport

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "LLUTMtrans", pth, True

Essentially the path to "My Documents" directory is being appended to the front of the "pth" value I am supplying to the function. This is confirmed in the feedback from the error raised. The table noted, "LLUTMtrans" does not exist in my database. I intend to create it as a new table. If I hard code in the path to the file this works just fine. I have no explanation as to why it is doing this? Has anyone else encountered this type of event?
 
Have you tried the TransferText method instead ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hey PHV.

Thanks for the response but for whatever reason today my code seems to work just fine. I still have no explanation for the results I was getting on Friday but that's the beauty of these MS apps I guess? A good reboot can go a long way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top