View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Run-time error '7'

Those are very, very large arrays and they take a lot of memory.
Also, you have not declared the j and k variables and that uses extra memory.
If you can use a Long data type, it will probably work for you.

In addition, they would be much more efficient if you eliminated the need for
the project level scope for the arrays and declared smaller arrays.
You can increase the size of the last dimension of an array at any time
using ReDim Preserve...

Public m2() As Long
Public m1() As Long

Public Sub jk()
Dim j as Long
Dim k as Long
j = 41000
k = 817
ReDim m1(j, k)
ReDim m2(j, k)
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Soquete"
wrote in message
I have gotten a Run-time error '7':
Out of memory

in the follwong code:
Public m2() As Double
Public m1() As Double
Public Sub jk()
j = 41000
k = 817
ReDim m1(j, k)
ReDim m2(j, k)
End Sub