Import multiple excel files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jim/Chris (anonymous_at_discussions.microsoft.com)
Date: 06/10/04


Date: Thu, 10 Jun 2004 10:06:56 -0700

I had to remove the ".xls" on the file names to use this.
Access doesn't like period in table names. You might be
able to trim that off. I hope this can help

This creates the tables with the same name as in the
directory C:\testimport\ without the ".xls"

Private Sub Command0_Click()
Dim filename As String
filename = Dir("c:\testimport\*.*")

Do Until filename = ""
 DoCmd.TransferSpreadsheet acImport, 8, filename,
"c:\testimport\" & filename, True, ""
    filename = Dir
Loop
End Sub

>-----Original Message-----
>Can anyone tell me how to import multiple files into an
>Access 2000 db. I have over 100 files I need to import.
>Thanks.
>.
>



Relevant Pages

  • Re: save to same file as opened
    ... I just re-checked to make sure of the extension, it is definitly xls. ... filename is the current month and day as 5-29 for today when you click on the ... xls with the default folder selected instead of the folder where the file ...
    (microsoft.public.excel.misc)
  • Re: save to same file as opened
    ... > I just re-checked to make sure of the extension, it is definitly xls. ... > save icon you get a Save as box with a filename of 5-291 with an extension ... > xls with the default folder selected instead of the folder where the file ... when you click on the save icon it just ...
    (microsoft.public.excel.misc)
  • Using VBA for manipulation of files
    ... I wrote a .bat file to change a filename from .xls to .txt ... parse through a folder and have it rename files for me ...
    (microsoft.public.access.modulesdaovba)
  • RE: TransferSpreadsheet saving file
    ... I have used the hardcoding of the filename "Central Western", ... user types in cw, it still saves it as Central Western and no mistakes are ... with capital .XLS. ... and cannot find anything that is in capitals. ...
    (microsoft.public.access.externaldata)
  • cannot open documents
    ... matter what type - so far xls, doc, ppt. ... or filename for http://server/sharepoint/site/shared ...
    (microsoft.public.sharepoint.windowsservices)