AnsweredAssumed Answered

Get count of files in state

Question asked by David Watkins on Jun 1, 2018
Latest reply on Jun 1, 2018 by David Watkins

I am making a Excel VBA macro to pull date for PDM, right now I would like to get a count for all the files in a state. I have this working but it is slower then I would like. I found that the "Set pos2 = state.GetFirstFilePosition " step is about 10-15 sec long and I call it 6 times (one time for each state). So does anyways know of a different/faster way to do the same thing?


relevant code


Dim state As IEdmState6

Dim wf As IEdmWorkflow6

Dim File As IEdmFile5


Set state = wf.GetState(StateName)

Set pos2 = state.GetFirstFilePosition ' this step is about 10-15 sec long

If Not pos2.IsNull Then

    Do While Not pos2.IsNull

        Set File = state.GetNextFile(pos2)

        Debug.Print File.Name

        StateCount = StateCount + 1


End If