LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default A question about Nothing

Hi Dave

No. "Set" allocates memory for something. Say you have an object X that uses 2Mb ram. Then
in theory it goes like this:

Set A as new X '2 Mb allocated for future use
Set B as new X 'and another 2
'.... do stuff with or without A and B, until
Set A as noting 'release A's 2 Mb for use elsewhere
Set B as nothing 'another 2

"In theory" because it doesn't always release, VBA or whatever program. In those cases you
have a "memory leak" and your Pc starts acting sluggish for no obvious or logical reason.
End Sub will or will not release memory, depending on wether the A variable is local or
not, and also on luck (memory leak II ). Anyway it's a very good coding habit to release
memory manually -we do have style after all ;-)
--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Dave F" wrote in message
...
Hi

I understand what Nothing does:

Set MyObject = Nothing

But I don't understand the reason for it.
Especially at the end of a routine

Doesn't End Sub do the same thing?

Dave F.





 
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
If Question Tango[_2_] Excel Discussion (Misc queries) 2 March 24th 10 02:35 PM
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM


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

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

About Us

"It's about Microsoft Excel"