Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Set array of objects to nothing

People have advised me to set object variables to nothing after they are no
longer needed:

Dim obj as Object
' do stuff
Set obj = Nothing

How do I set an array of objects to nothing?

Dim obj() as Object
ReDim obj(1 to Windows.Count)
' do stuff
' Set obj() = Nothing

Thanks,
Matthew Pfluger
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Set array of objects to nothing

You could loop through the array setting each item = Nothing or use 'Erase',
see help. They are not quite the same thing so use either method as
required.

If your array of objects is about to go out of scope it's not normally
necessary to explicitly release any object references it holds.

Regards,
Peter T

"Matthew Pfluger" wrote in
message ...
People have advised me to set object variables to nothing after they are

no
longer needed:

Dim obj as Object
' do stuff
Set obj = Nothing

How do I set an array of objects to nothing?

Dim obj() as Object
ReDim obj(1 to Windows.Count)
' do stuff
' Set obj() = Nothing

Thanks,
Matthew Pfluger



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Set array of objects to nothing

Very good. Thanks!

"Peter T" wrote:

You could loop through the array setting each item = Nothing or use 'Erase',
see help. They are not quite the same thing so use either method as
required.

If your array of objects is about to go out of scope it's not normally
necessary to explicitly release any object references it holds.

Regards,
Peter T

"Matthew Pfluger" wrote in
message ...
People have advised me to set object variables to nothing after they are

no
longer needed:

Dim obj as Object
' do stuff
Set obj = Nothing

How do I set an array of objects to nothing?

Dim obj() as Object
ReDim obj(1 to Windows.Count)
' do stuff
' Set obj() = Nothing

Thanks,
Matthew Pfluger




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
XL2002 - Select All Objects in an Array... Trevor Williams Excel Programming 5 June 21st 07 12:35 PM
Test for end of array of objects? peter Excel Programming 8 February 3rd 05 09:15 AM
Trying To Store Shapes/Objects to an array ?? Tom Ogilvy Excel Programming 2 September 21st 04 09:49 PM
Trying To Store Shapes/Objects to an array ?? Dan Thompson Excel Programming 0 September 21st 04 08:37 PM
How can you make an array of objects? ynotravid Excel Programming 7 August 28th 04 10:19 PM


All times are GMT +1. The time now is 12:26 PM.

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"