Improting Excel with Multiple spreadsheets

  • Thread starter Thread starter Andrea
  • Start date Start date
A

Andrea

I want to import an Execl Workbook with 3 worksheets that contain the same
fields. I try to import into Access, and use the append feature, but every
time I tried to add it to the existing table, I get an error message that
Field' Loc # ID does not exist in the table. I am not using a primary key.

Can anyone help? Andrea
 
Go ahead and allow Access to set a primary key. You can always delete it
later if you need to but it usually imports easier if you do. But, since the
sheets contain the same fields, you may have to use VBA. Use:
Docmd.transferspreadsheet acimport,, "your spreadsheet name", "your
spreadsheet location C:\something), true (if you want to import the headers),
"sheet1!A3:g234"
That will tell it exactly what you want to import.
 
Hey Milton,

Sorry it took me so long to read your thread but I never got the notification.

Where and how would I use the VBA funtcion. I have created the database and
want to inport all the worksheets.

Thanks,

Andrea
 
Back
Top