I sometimes experience this problem in Access 2007, too. Sometimes I am not able to import from Excel 2007 into an existing table. The existing table was created by a prior import process. I can import into a new table without any problem. However,
if I have to do that every time, then that reduces the efficiency of the application. It seems like the table in Access somehow becomes corrupted, but I'm not sure why. It would be nice if Microsoft would make the error reporting more robust. Stating "subscript
out of range" is like calling 911 and stating "there is an accident somewhere in the city".
For anyone else who made need help, my issue was that my original table in access that I was appending to was also imported from Excel to Access and Access did not make my primary key column an Autonumber data type. So I had to:
- go to my original table in Access, and in Design view create another field called NodeID (NodeID was already the primary key in my table when I imported from Excel but Access didn't make it Autonumber data type--Access made it just a Number data type).
- made it so the old NodeID field was no longer the primary key field.
- set new NodeID field to Autonumber data type, and then made it a primary key.
- I then moved the two NodeID fields together and viewed the table in datasheet view to make sure the autonumbers matched up with the NodeID field that I originally had.
- I deleted the old NodeID field and was left with the new NodeID primary key field that is now an Autonumber data type.
Then I was able to append to this table from a table in Excel. When I import tables into Excel, I now always open the table in Design view and check that Access matched the data types correctly.
Besides the primary key ID field getting changed to just a Number data type vs. an Autonumber, sometimes Comment fields will be set to Short Text and I need them as Long Text (or Memo in the older versions of Access), for example, and Access might make other
changes, too.
P.S. As others mention, I also made sure the column headings matched between Excel and Access exactly and that the columns in Excel are formatted to match format of the columns in Access, so date fields need to be formatted as date fields in Excel, numbers
fields (especially primary or foreign key fields--the ID fields) need to be formatted as numbers in Excel.