J
Jay
Hi all
I'm trying to read the contents of a folder, find the files I want in that
folder, and then import them into tables within Access .. But I'm getting a
pretty major problem in the "reading the contents .. " part :
Set fs = Application.FileSearch
With fs
.LookIn = "C:\BB Stats\Season" & txtSeason & "\Week" & txtWeek
.FileName = "*.htm"
If .Execute(SortBy:=msoSortbyFileName,
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .foundfiles.Count
Squads(i) = .foundfiles(i)
Next i
End With
The problem I'm getting is that everything just hangs at the If .Execute
statement .....
Now, the crazy thing about this is that I've done this one or two times
before in other things and it worked fine .. So, because I'm lazy, I just
lifted the code out of the previous things and pasted it in, changing just
the directory where I'm looking (the .Lookin) .. BUT
... going back to where I copied the above code from, now THAT doesn't work,
yet it worked fine in the past ..
Anybody any ideas?
Thx in advance
J
I'm trying to read the contents of a folder, find the files I want in that
folder, and then import them into tables within Access .. But I'm getting a
pretty major problem in the "reading the contents .. " part :
Set fs = Application.FileSearch
With fs
.LookIn = "C:\BB Stats\Season" & txtSeason & "\Week" & txtWeek
.FileName = "*.htm"
If .Execute(SortBy:=msoSortbyFileName,
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .foundfiles.Count
Squads(i) = .foundfiles(i)
Next i
End With
The problem I'm getting is that everything just hangs at the If .Execute
statement .....
Now, the crazy thing about this is that I've done this one or two times
before in other things and it worked fine .. So, because I'm lazy, I just
lifted the code out of the previous things and pasted it in, changing just
the directory where I'm looking (the .Lookin) .. BUT
... going back to where I copied the above code from, now THAT doesn't work,
yet it worked fine in the past ..
Anybody any ideas?
Thx in advance
J