Private Sub PurgeRuns() ' Purge runs from open test sets that did not pass Dim tsFact As ITestSetFactory Dim runFact As IRunFactory Dim tsFilter As ITDFilter Dim runFilter As ITDFilter Dim oList As IList 'Set filter for open test sets. Set tsFact = tdc.TestSetFactory Set tsFilter = tsFact.Filter tsFilter.Filter("CY_STATUS") = "Open" 'Set filter for runs that did not pass. Set runFact = tdc.RunFactory Set runFilter = runFact.Filter runFilter.Filter("RN_STATUS") = "Not Passed" Dim KeepLast Dim DateUnit Dim UnitCnt Dim StepsOnly KeepLast = 0 ' Keep none DateUnit = 1 ' Days UnitCnt = 0 ' 0 days indicates runs from today and back StepsOnly = False ' Purge runs, not just steps tdc.PurgeRuns2 tsFilter.Text, runFilter.Text, _ KeepLast, DateUnit, UnitCnt, StepsOnly End Sub