Import multiple excel files
From: Jim/Chris (anonymous_at_discussions.microsoft.com)
Date: 06/10/04
- Next message: Miri: "Import multiple excel files"
- Previous message: Jim/Chris: "Import multiple excel files"
- In reply to: Jim/Chris: "Import multiple excel files"
- Next in thread: Miri: "Import multiple excel files"
- Messages sorted by: [ date ] [ thread ]
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.
>>.
>>
>.
>
- Next message: Miri: "Import multiple excel files"
- Previous message: Jim/Chris: "Import multiple excel files"
- In reply to: Jim/Chris: "Import multiple excel files"
- Next in thread: Miri: "Import multiple excel files"
- Messages sorted by: [ date ] [ thread ]