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!

Docmd transferspreadsheet with.xslx

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I have the following line in vba in access 2007:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Floor_Execution_Import", str, True, "B4:H30"

The format of the data in the .xslx is as follows:


ELECTRONIC
Date ELECTRONIC Ticket # Account # B/S Quantity Month Product
Tuesday, July 10,2012
electronic 245 48795849 b 1 q lh
electronic 621 25212375 s 1 z yc
electronic 2 61533013 b 1 q s
electronic 246 25212375 b 1 z yc

The range includes only the data starting at electronic and ending at yc (obviously including a few extra rows in case the user has more information). Unfortunately, when I try to import it into the SQL Server 2008 R2 table I get the following error:

Run-time error '2391':
Field'245' doesn't exist in destination table 'Floor_Execution_Import'.

The table Floor_Execution_Import has the following fields:

Electronic varchar(50)
Ticket varchar(50)
Account varchar(50)
BS varchar(50)
Quantity varchar(50)
Month varchar(50)
Product varchar(50)

I really cannot see why this error message is being produced. Can anyone help me on this one? Any help is appreciated. Thanks.

Dave


 


Your table data is hard to understand.

Why don't you have the DATE on each line in the Excel Table? I only see ONE DATE (Tuesday, July 10,2012) and I assume that this is a REAL DATE and not just TEXT.

Doesn't your Excel Table have 1) ROW 1 HEADERS and 2) ROW 2 and following have DATA

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top