PC Review


Reply
Thread Tools Rate Thread

Array retained in memory despite procedure execution ended

 
 
=?Utf-8?B?RWRtdW5k?=
Guest
Posts: n/a
 
      13th Jul 2007
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 With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      13th Jul 2007
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" <(E-Mail Removed)> wrote in message
news:F1851571-28E1-47FD-B3BE-(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why does the execution jump to another procedure? Harold Good Microsoft Excel Programming 4 14th May 2009 02:21 PM
too much for stored procedure execution Keith O Microsoft ADO .NET 3 15th Feb 2005 07:19 PM
need to limit or disable files being retained in memory or cache Cyndee Windows XP Performance 2 3rd Sep 2004 05:08 PM
Program Retained In Memory When Shut Down Edward W. Thompson Windows XP General 1 16th Aug 2004 12:33 PM
Scheduling Procedure execution Sonali Microsoft VB .NET 1 1st Dec 2003 08:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:38 PM.