Thread: Memory Problem
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Memory Problem

What version of Excel are you using? You're probably running up
against Excel's own memory limitations. See
http://www.decisionmodels.com/memlimitsc.htm for more detailed
information. You're allocating 13,000,000 elements in the array,
each a variant. A variant requires 22 bytes of memory plus
memory to hold the contents of the variant, so right out of the
box you're allocating about 286MB. Once you start putting values
in the array, you'll go even higher.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"ExcelMonkey " wrote
in message ...
I keep getting an out of memory error (error 7) when I run

this.

Dim DataArray As Variant
Din AMax As Long
Dim BMax As Long
Dim CMax As Long

AMax = 65000
BMax = 200
CMax = 1

ReDim DataArray(1 To AMax, 1 To BMax, 1 To CMax)

Am I simply running too many loops for excel to handle?


---
Message posted from http://www.ExcelForum.com/