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
Ofer - 31 Jul 2005 00:05 GMT
Look at TransferSpreadsheet command line
docmd.TransferSpreadsheet
acImport,acSpreadsheetTypeExcel7,"TableName","FileName+Location"
> Hi, Guys
>
[quoted text clipped - 5 lines]
>
> Kevin
Marshall Barton - 31 Jul 2005 00:26 GMT
>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.

Signature
Marsh
MVP [MS Access]