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

Impoting Excel file into Access

Status
Not open for further replies.

only412c

MIS
Jan 29, 2003
32
US
I am trying to import Excel97 and Excel 2000 files into access but somehow it keeps going to the Error routine, when the DoCmd.TransferSpreadsheet is encounter. Below is the the method I am using.

MCOWAdata is the name of the Access table
Me.namedfile is the variable used to capture the file name after user uses browses through the directory. The Excel file does not have any headings.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "MCOWAdata", Me.namedfile, False


Is there anything else I should add? Am I using the right format for the DoCmd TransferSpreadsheet?

Thanks in advance,

JL[\b]
 
Thanks,

I used the ! but still get me to the error routine.
 
What is the error?

Another thing you can do is to set up transfer text as a macro and test it. You could then convert to VB after you get it working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top