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!

TransferSpreadsheet error

Status
Not open for further replies.

AccessHelp123

Programmer
Apr 27, 2005
91
US
Hi,

I am trying to import several sheets from an excel file into an access table using the VBA code below in MS Access.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tbl_Sheet1", strFile, True, "Sheet1!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tbl_Sheet1", strFile, True, "Sheet2!"
.. and so on....

This command works on my laptop but when one of the users tries to run the code they get an error saying
Field 'Technology' doesn't exist in the destination table 'tbl_Sheet1.'
"Technology" is a constant value in the first column named "Group" in the excel sheet "Sheet1". The Access table tbl_Sheet1 has the first column name as "Group".
The excel file has a few empty rows in Sheet1. Does Access consider this to be the end of the file and consider the next row with data to be the header or something? ... I cant think of a reason why this would work on my computer and not someone else's.

Any help regadring this would be great. Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top