This won't work:
VB Code:
Public Sub ClearCollection(myCollection As Collection) For i = 1 To myCollection.Count myCollection.Remove (i) Debug.Print i & " - " & myCollection(i).sFileName Next End Sub
I'm getting a "subscript out of range" error
It is really strange. If i don't commment out the remove command and just print out the values, then it works fine. Does removing the items somehow mess up the index?
I'm really just trying to clear all the values out of the collection.
thanks




Reply With Quote