Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel: Array & Memory

hi,

i got the fct below from Microsoft (this is to copy/paste
data from an ADODB recordset to Excel sheet).
Thing is that memory usage keeps growing each time I use
the function till the fatal msg "Not enough memory
available..."
I think this has to do with memory not being released once
the array has been used.
The 'Erase' doesn't work, the 'Nothing' either...

Tks to help,
Eric/


Function fct_TransposeDim(v As Variant) As Variant
' Custom Function to Transpose a 0-based array (v)

Dim X As Long, Y As Long, Xupper As Long, Yupper As
Long
Dim tempArray As Variant

Xupper = UBound(v, 2)
Yupper = UBound(v, 1)

ReDim tempArray(Xupper, Yupper)
For X = 0 To Xupper
For Y = 0 To Yupper
tempArray(X, Y) = v(Y, X)
Next Y
Next X

fct_TransposeDim = tempArray

Erase tempArray
'tempArray = Nothing

End Function
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
XL 2007 - Out of Memory - memory leak/bug? PCLIVE Excel Discussion (Misc queries) 0 March 23rd 09 03:31 PM
Excel VB Out of Memory Annette Excel Discussion (Misc queries) 0 December 19th 07 07:29 PM
Excel memory not working Daria Excel Worksheet Functions 2 September 14th 07 07:50 PM
create an array with unique items IN MEMORY Werner Rohrmoser Excel Worksheet Functions 1 September 25th 05 02:55 PM
Excel+Not Enough Memory.. Olly[_2_] Excel Programming 3 July 9th 03 03:39 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"