For a collection just:
Or you could just use an array, type of Long.Code:Dim c As Collection c.Add hDir
Code:Dim arr() As Long 'outside of click event 'after CreateFile call ReDim Preserve arr(1 To UBound(arr) + 1) 'make a new element arr(UBound(arr)) = hDir 'assign handle to last element 'to close Dim l As Long For l = 1 To UBound(arr) CloseHandle arr(l) Next l




Reply With Quote