alexkeel79
MIS
I'm working on a script to import all of the files in a given directory into my access DB. Basically what I am trying to do is get a list of all the files in the given directory and then loop through all of those files and import their content into the DB. I found an example to be used for Excel VBA that I thought would transfer but I was wrong. Here is the code I tried:
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scription.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scription.FileSystemObject
Set SourceFolder = FSO.GetFolder("O:\Risk Migration\CSV Files\ACC")
r = 5
For Each FileItem In SourceFolder.Files
MsgBox FileItem.Name, vbOKOnly
Next FileItem
Any ideas?
thx...
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scription.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scription.FileSystemObject
Set SourceFolder = FSO.GetFolder("O:\Risk Migration\CSV Files\ACC")
r = 5
For Each FileItem In SourceFolder.Files
MsgBox FileItem.Name, vbOKOnly
Next FileItem
Any ideas?
thx...