Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
XL 2007 - Out of Memory - memory leak/bug? | Excel Discussion (Misc queries) | |||
Excel VB Out of Memory | Excel Discussion (Misc queries) | |||
Excel memory not working | Excel Worksheet Functions | |||
create an array with unique items IN MEMORY | Excel Worksheet Functions | |||
Excel+Not Enough Memory.. | Excel Programming |