Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Clarification needed about Scope Of Variables

Thanks all, I guess it's just safer to dereference the objects... I've
created.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Clarification needed about Scope Of Variables

Well it certainly doesn't hurt.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"vmegha" wrote in message
oups.com...
Thanks all, I guess it's just safer to dereference the objects... I've
created.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clarification needed about Scope Of Variables

Well it certainly doesn't hurt.

Contradicting your own post?

Setting them to Nothing
yourself is a waste of code: VB has to check if they are Nothing anyway and
always generates the code the code to release them, so you're just
duplicating existing code.


Also, unneeded teardown code
obscures necessary teardown code buy burying it in a bunch of noise, which
makes it harder to maintain the real teardown code.


As to Remy's comment, has he ever written a strictly Excel internal vba
procedure that won't let Excel close because an object reference is
retained. I grant that his comment is correct for C++, but in VBA, VBA
handles that for the coder. If referencing automation, then the problem
with automation is not with Set statements, but with the creation of
implicit references that can not be released.

--
Regards,
Tom Ogilvy




"Bob Phillips" wrote in message
...


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"vmegha" wrote in message
oups.com...
Thanks all, I guess it's just safer to dereference the objects... I've
created.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Clarification needed about Scope Of Variables

Life and learn...
But yeah, too much C++ background. Glad C# is here :-)

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
Scope of Variables leerem Excel Discussion (Misc queries) 4 September 30th 08 12:54 PM
Public variables and scope Dennis Benjamin Excel Programming 3 December 2nd 05 04:41 AM
VERY Basic Define Variables Help Needed BEEJAY Excel Programming 12 September 30th 05 08:10 PM
Scope of variables Purnima Excel Programming 1 April 5th 05 05:59 AM
clarification Michael Joe Excel Programming 3 August 13th 04 09:49 PM


All times are GMT +1. The time now is 09:50 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"