Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Does VBA have a garbage collector?

I am starting to learn VB.NET. I know VB.NET has garbage collection so you
don't have to destroy the object in code. Does VBA have a form of garbage
collection or is it best to destroy the object manually in code?
--
Cheers,
Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Does VBA have a garbage collector?

Yes. Typically I'm sure it's fine, if not better, to let VB's garbage
collection destroy objects naturally when they are about to fall out of
scope (eg procedure level objects as the procedure terminates).

You will still need to destroy static or module level objects when done.
Also there are certain scenarios that lead to circular references where a
particular object will need to be released first (probably a rare scenario
in VBA).

Some prefer to explicitly destroy all objects but that's more a matter of
style.

Regards,
Peter T



"RyanH" wrote in message
...
I am starting to learn VB.NET. I know VB.NET has garbage collection so you
don't have to destroy the object in code. Does VBA have a form of garbage
collection or is it best to destroy the object manually in code?
--
Cheers,
Ryan



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OPC Data Collector tmkkoservo Excel Programming 0 August 20th 07 03:58 PM
Garbage collection in VBA Edward Ulle Excel Programming 5 December 16th 05 05:59 PM
Excel opening w/ garbage WLMPilot Excel Discussion (Misc queries) 2 December 13th 05 02:43 AM
Deleting garbage Sandra[_6_] Excel Programming 13 May 5th 05 05:47 PM
delete garbage from worksheet mkk Excel Programming 2 February 18th 04 07:31 PM


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"