Help! with Excel import

G

Guest

Can anyone help me with this one? When I attempt to reimport an Excel file, I get the error "Error occurred trying to import file 'XYZ'. The file was not imported." This is what happens: I import the Excel file the first time, creating a new table, with no problem. I then go into that new table, delete all records, and close the table. Then I try to import the same exact Excel table again, but this time I specify importing the file into an existing table--the one I just created. That is when I get the error above. I don't understand why this doesn't work since the Excel file should have created all the parameters it needed the first time. Furthermore, this problem doesn't occur when I import the file as a .csv (comma-delimited) file. Any help with this
 
J

Joe Fallon

Use TransferSpreadsheet to do this instead of doing it manually.
Then you can identify the existing table.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, strTableName,
strLocalDir & strLocalFileName, True

--
Joe Fallon
Access MVP



DonnaD said:
Can anyone help me with this one? When I attempt to reimport an Excel
file, I get the error "Error occurred trying to import file 'XYZ'. The file
was not imported." This is what happens: I import the Excel file the first
time, creating a new table, with no problem. I then go into that new table,
delete all records, and close the table. Then I try to import the same
exact Excel table again, but this time I specify importing the file into an
existing table--the one I just created. That is when I get the error above.
I don't understand why this doesn't work since the Excel file should have
created all the parameters it needed the first time. Furthermore, this
problem doesn't occur when I import the file as a .csv (comma-delimited)
file. Any help with this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top