LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Out of Memory" error

I have a VBA based model that creates very large arrays. It ran OK in nExcel
2002 and 2003, but the first time I tries to run it in Excel 2007 I got an
"Out of Memory" error. This appears to happen as memory is being allocated to
arrays when the simulation is first being initiated.

To try to isolate the problem, I created a very simple macro that does
nothing except create a 2-dimensional array:

Dim Array1() as single
Sub TestArray()
ReDim Array1(10000, 10000)
' Pause here using break point to check memory usage
in Task Manager
Erase Array1
End Sub

Increasing the array dimension too much above 10000 x 10000 results in the
"out of Memory" error. Prior to running the macro, Task Manager lists Excel
using about 27,000 K of memory.
Pausing the program part way with the array set at 10000 x 10000, Excel is
using 420,000 K. At 15000 x 11500, the memory usage was 740,000 K. At 15000
x 12000, I got the error.

I tried the same thing in Excel 2003 and got similar results, although with
a slightly larger array size before the error popped up.

It was my understanding that Excel 2002 and 2003 were limited to accessing a
maximum of 1 GB of RAM, while Excel 2007 was limited only by the physical
RAM. If that were the case, shouldn't my array size limits be much larger
running Excel 2007? Or is there still a memory size limit with VBA?

Old machine where my simulator worked: Pentium 4, 2 GB RAM, XP pro SP2,
Office 2003

New Machine where simulator encounters "Out of Memory" error: AMD Athlon
Dual Core, 4 GB RAM, XP Pro x64 SP2, Office 2007

Any thoughts?

 
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
The Instruction at "0x749860a0" referenced memory at "0x00000000" Tribeca Excel Discussion (Misc queries) 1 July 5th 08 12:41 AM
Runtime Error "7": Out of Memory Run Time Error 7 Excel Programming 0 November 10th 05 12:00 PM
Excel:Runtime Error 7 "Not enough Memory" with CreateObject (SAP.B sebastienm Excel Programming 0 July 24th 04 08:35 AM
too many external links give "Not Enough Memory" error lothario[_67_] Excel Programming 0 January 13th 04 04:03 AM
The instruction at "0x65255ac9" referenced memory at "0x00000008". The memory could not be read. Clikc OK to terminate etc Angus Comber[_2_] Excel Programming 1 November 7th 03 01:18 PM


All times are GMT +1. The time now is 03:52 AM.

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"