Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following code to conduct a filesearch and write the files
found to an array: k = 0 For i = 1 To UBound(myFolders) With Application.FileSearch .NewSearch .LookIn = myFolders(i) .SearchSubFolders = False .FileName = "*.csv" If .Execute() 0 Then ReDim Preserve filelist(1 To k + .FoundFiles.COUNT) For j = 1 To .FoundFiles.COUNT k = k + 1 filelist(k) = .FoundFiles(j) Next j Else MsgBox "There were no files found." End If End With Next i The code works well only the first time run after restarting excel. However, if I have already run the code, then add files to any previously selected paths, the code only sees the files that were there during the first execution of the code? Any ideas? Smokii |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filesearch in VB6 | Excel Programming | |||
FileSearch | Excel Programming | |||
FileSearch using VBA | Excel Programming | |||
.FileSearch | Excel Programming | |||
FileSearch Problem | Excel Programming |