ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array retained in memory despite procedure execution ended (https://www.excelbanter.com/excel-programming/393279-array-retained-memory-despite-procedure-execution-ended.html)

Edmund

Array retained in memory despite procedure execution ended
 
I dont 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. Its driving me nuts !

Whatever had caused the array to retain in memory even after execution has
been completed, Im 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


NickHK

Array retained in memory despite procedure execution ended
 
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

"Edmund" wrote in message
...
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





All times are GMT +1. The time now is 05:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com