Results 1 to 20 of 125

Thread: Combine recursive listing with excluded code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    It seems like there is a number of changes in the current version of excludes_14 from previous versions:
    These have been removed, from comparing the older versions of exclude_#.xlsx with excludes_14.xlsx
    1.
    Dim numRuns As Long
    has been removed

    2.
            'see how many runs were packed in by counting "Parent Folder"
            numRuns = Application.WorksheetFunction.CountIf(wsOut.Columns(colFileFolder), "Parent Folder")
    has been removed

    3.
    If numRuns > 0 Then RemoveDups
    has been removed

    4.
    Private Sub RemoveDups()
        Dim rowNew As Long
        For rowNew = wsOut.Cells(1, 1).CurrentRegion.Rows.Count To rPrev.Rows.Count + 1 Step -1
            If Application.WorksheetFunction.CountIf(rPrev.Columns(colParent), wsOut.Cells(rowNew, colParent).Value) > 0 Then
                'mark special
                wsOut.Cells(rowNew, colParent).Value = True
            End If
        Next rowNew
        On Error Resume Next
        wsOut.Columns(colParent).SpecialCells(xlCellTypeConstants, xlLogical).EntireRow.Delete
        On Error GoTo 0
    End Sub
    has been changed to:

    Private Sub RemoveDups()
        wsOut.Cells(1, 1).CurrentRegion.RemoveDuplicates Columns:=1, Header:=xlYes
    End Sub
    Does this new code do exactly the above code and only keeps 1 type of entry and removes all other duplicates from column 1?

    Also,
    wsOut.Cells(rowOut, colParent).Value = RemovePrefix(.ParentFolder.path)
    has been modified to
    wsOut.Cells(rowOut, colParent).Value = oFSO.GetParentFolderName(.Path)
    isnt .ParentFolder.path the same thing as oFSO.GetParentFolderName(.Path) ??

    Private Function RemovePrefix(s As String) As String
        If Len(s) < 5 Then
            RemovePrefix = s
        Else
            RemovePrefix = IIf(Left(s, 4) = "\\?\", Right(s, Len(s) - 4), s)
        End If
    End Function
    has been removed.. Why is this so?

    For i = LBound(aryExclude) To UBound(aryExclude)
          aryExclude(i) = RemovePrefix(CStr(aryExclude(i)))
    Next i
    has been changed to:
    For i = LBound(aryExclude) To UBound(aryExclude)
                aryExclude(i) = CStr(aryExclude(i))
            Next i
    This only removes the long folder path prefix from the exclude list and not the parent folder column (2). It was done before in previous workbooks but not the new excludes_14...

    How come:
    Call GetFiles(oFSO.GetFolder(RemovePrefix(sPathTop)))
    generates error message saying "Run time error '76': Path not found" for the same parent folder even if its a longer folder path exceeding 260 characters??
    Last edited by Aussiebear; 07-10-2024 at 01:31 AM.

Posting Permissions

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