Read Excel files into database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, Guys

I got thousands of same format Excel files which needed to be imported into
access, is there a code or tool can help me out? u quick response is trully
appreciated.

Thanks a lot!

Kevin
 
Look at TransferSpreadsheet command line

docmd.TransferSpreadsheet
acImport,acSpreadsheetTypeExcel7,"TableName","FileName+Location"
 
Kevin said:
I got thousands of same format Excel files which needed to be imported into
access, is there a code or tool can help me out? u quick response is trully
appreciated.


You can not import entire files into an Access table, but
you can import well organized data from an area on an Excel
sheet to an Access table (see TransferSpreadsheet method in
Help). You could create a VBA procedure to loop through the
files and use TransferSpreadsheet import the data.

It's also possible to write VBA code to construct SQL
statements that will retrieve an Excel Sheet or Named Range
and put it into a table.

Unlikely to be useful with thousands of files, bit it's not
absolutely necessary to import the data, you can link to a
sheet or named range instead.

All this is based on the sheet or range data being in a
nice, regular layout without extraneous stuff like notes or
totals in the middle of it.
 

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

Back
Top