Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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



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
Blank Message Box after procedure execution [email protected] Excel Programming 7 June 1st 07 01:13 PM
Array Maintaining its values after execution [email protected] Excel Programming 3 May 21st 07 09:19 PM
array storage in memory Albert Excel Programming 1 November 19th 06 12:47 AM
Values assigned to variables staying in memory when procedure stop Peter Rooney Excel Programming 4 August 12th 05 03:13 PM
Function/Procedure dependence & order of execution Jon L Excel Programming 1 October 3rd 04 10:06 AM


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