Import multiple excel files

Tech-Archive recommends: Fix windows errors by optimizing your registry

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


Date: Thu, 10 Jun 2004 11:41:41 -0700

I got it now without renaming the files

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

Do Until filename = ""
 DoCmd.TransferSpread*** acImport, 8, Left(filename,
InStr(filename, ".") - 1),"c:\testimport\" & filename, True, ""
  filename = Dir
>Loop
>End Sub

I tested this and it works

Jim

>-----Original Message-----
>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.TransferSpread*** 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.
>>.
>>
>.
>


Quantcast