Array retained in memory despite procedure execution ended

E

Edmund

I don’t know why but even after the codes have finished executing, the arrays
(ColsToParse, ColList, ListofFormat) seems to retain themselves in memory.
When I execute the procedure again, it never seem to have been destroyed at
all. This is supposed to be impossible. It’s driving me nuts !

Whatever had caused the array to retain in memory even after execution has
been completed, I’m not interested. Bottom line is, how can I “destroy†the
array at the start of the procedure?

I tried inserting this as the first lines of the procedure but failed:
Set ColsToParse = Nothing
Set ColList = Nothing
Set ListofFormat = Nothing

Thanks a lot

===========================
Exerpt of my module:
===========================
Option Explicit
Option Base 1

Const APPNAME = "BOOSTER"

Dim LastRow As Long, LastCol As Long, Table As Range, MyRng As Range
Dim Msg As String, MyStr As String, c
Dim n, v, ColsToParse, FindThis, ReplaceWith As String
Dim i As Long, ColList(), ListofFormat(), found As Long, TempColNum As Long
Dim Ans As Integer, FormatType As String

Sub aUniversalParsingExcelB2WIN_4()
Call CheckIfFormattedBefore
Call Protocol_OnEntry
Call IdentifyTarget
Call SummarizeAndMemTargetList
Call ParseTarget
Call L2_MainProc_Cycle_T2C_Selection
Call FinalFormatting
Call Protocol_OnExit
End Sub
 
N

NickHK

Edmund,
You need to read up on Scope of variables and possibly the VBA Help section
on "Declaring Variables".

Also, Nothing is used with Object, not arrays. Check out Erase.

As you seems to have Variant containing an array and also array of Variants,
make sure you understand the difference.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top