I'm using the following code as part of a recursive subroutine to find files in all subfolders of a user specified intital folder.
As shown, the code works fine. If I uncomment the commented lines and comment the 3 If statements, however, it no longer works, that is, the program does not skip the specified folders even though matches are being found. Does anyone see any problems in this code. Thanks,
Paul Hudgens
Denver
Code:
Set f = fs.GetFolder(FolderSpec)
Set fc = f.SubFolders
For Each F1 In fc
'ChkFldr = FolderSpec & "\" & F1.Name
'For i = 1 To iIgnoreFldrCnt
' If ChkFldr = IgnoreFldrs(i) Then
' MsgBox "Match found"
' GoTo NextF1
' End If
'Next i
If Trim(LCase(F1.Name)) = "fmi" Then GoTo NextF1
If Trim(LCase(F1.Name)) = "offsetwelldata" Then GoTo NextF1
If Trim(LCase(F1.Name)) = "petrel" Then GoTo NextF1
Call ShowFolderInfo(FolderSpec & "\" & F1.Name, FileWks, IgnoreFldrs, iIgnoreFldrCnt)
NextF1:
Next F1
As shown, the code works fine. If I uncomment the commented lines and comment the 3 If statements, however, it no longer works, that is, the program does not skip the specified folders even though matches are being found. Does anyone see any problems in this code. Thanks,
Paul Hudgens
Denver