I get an Excel VBA "Out of Memory" error, but I have 4 GB RAM

C

CraigFarnden

In excel 2007, I get "out of memory" errors that didn't occur in Excel 2003.
This appears to happen as memory is being allocated to some very large
arrays.

It was my understanding that Excel 2007 could use all available RAM as
opposed to the 1 GB limit imposed in Excel 2003.

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 - use Task Manager to
check Excel memory usage
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. the "Out of Memory" error occurs.

I'm running Office 2007 with Windows XP Pro x 64 Edition, SP 2 on an Athlon
64x2, 2.21 GHz, 4 GB RAM.

Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top