Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code that intializes a new collection, runs code using the
collection and then ends. Do I need to destroy the collection so it doesn't take up memory or does this automatically happen when the procedure is over? Is there a way to see what is in memory? Option Explicit Private Sub cboMounting_Change() Dim colPoleSpecsAll As Collection Dim colPoleSpecsData As Collection Dim ctrl As Control Set colPoleSpecsAll = New Collection With colPoleSpecsAll .Add lblPoles .Add cboPoles .Add lblShape .Add cboShape .Add lblFieldPoleSize .Add cboFieldPoleSize End With Set colPoleSpecsData = New Collection With colPoleSpecsData .Add cboPoles .Add cboShape .Add cboFieldPoleSize End With If cboMounting.ListIndex 1 Then For Each ctrl In colPoleSpecsAll ctrl.Enabled = True Next ctrl For Each ctrl In colPoleSpecsData ctrl.BackColor = vbWindowBackground Next ctrl Else For Each ctrl In colPoleSpecsAll ctrl.Enabled = False Next ctrl For Each ctrl In colPoleSpecsData ctrl.BackColor = vbButtonFace Next ctrl End If End Sub -- Cheers, Ryan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you destroy a specific object or collection? | Excel Programming | |||
Search & Destroy | Excel Programming | |||
Search and destroy | Excel Programming | |||
How to make VBA code to self-destroy itself? | Excel Programming | |||
Seek and destroy | Excel Programming |