View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
vivmaha vivmaha is offline
external usenet poster
 
Posts: 42
Default How to terminate an object that's in a collection

"Coll" is a standard VBA Collection object.
The first item in it is a MyClass object.
How do I delete this object? (and free the memory used)

This does not work:
Coll.remove 1 'The memory of item 1 is still allocated

This crashes:
Set Coll.item(1) = nothing '<Crash occurs here (Err 438)
Coll.remove 1

Thanks.