View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Edward Ulle Edward Ulle is offline
external usenet poster
 
Posts: 92
Default Garbage collection in VBA

I had read that its good practice to set instances of class to Nothing
to free up the memory.

Is there garbage collection in VBA?

Also is there any benefit to setting Application Object Model class
variables to Nothing upon exiting a procedure or function? For example

Dim myRange as Range

Set myRange = Something

Do some code

Set myRange = Nothing

Exit Function

Or is the memory allocated in the function returned to the heap when the
function goes out of scope?



*** Sent via Developersdex http://www.developersdex.com ***