Results 81 to 100 of 125

Thread: Combine recursive listing with excluded code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    if I wanted the complete path for each specific folder or specific file to be excluded...
    What I mean by this is if I wanted a specific file path to be excluded such as "C:\test with spaces\subfolder 1\file1.txt" I can change the code from:
    For i = LBound(aryFiles) To UBound(aryFiles)
            If UCase(p.Name) = UCase(aryFiles(i)) Then Exit Function
        Next i
    to
    For i = LBound(aryFiles) To UBound(aryFiles)
            If UCase(p.Path) = UCase(aryFiles(i)) Then Exit Function
        Next i
    instead of file1.txt being excluded everywhere in every subfolder, by changing the p.Name to p.Path, i can pin-point the exact file path to be excluded

    That tells Redim Preserve how many more spaces to allocate. I had it set low for testing, but might slow things down
    Const incFilesFolders As Long = 10
    Do you mean resizing the array by 10 at code execution?

    It seems like for long folder/file paths which is 246 characters in length in cell A1, there is a run-time error 9 - subscript out of range occuring and
    For i = LBound(aryExcludes) To UBound(aryExcludes)
    is highlighted after i click debug under the sub "isFolderExcluded"
    Last edited by anmac1789; 05-10-2021 at 07:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •