I think you should sort out why you are getting an error with a tiny
array of 50 x 50 numbers. 2500 elements is peanuts. 500 x 500 should be
no problem. 5000 x 5000, or 25 million elements, might be a problem.
There must be something else you are doing that is causing the problem.
As far as using Excel from VB, set a reference in VB to the Excel Object
Library. You can then declare variables of type Excel.Application,
Excel.Workbook, Excel.Worksheet, Excel.Range, etc. and run excel
directly from your VB app.
"Tmenke" <me*****@netscape.net> wrote in message
news:QR***************@fe40.usenetserver.com...
| I'm sorry if I wasn't clear. The first program I wrote was in VBA for
excel.
| I want to take the code
| from the program and compile it with VB to see if will bust the memory
like
| my VBA app is doing as my dynamic arrays get larger. The content of
the
| array is all numbers but it is declared as variant (default). I have
bad
| programming habits , I am only a hobbiest and not a professional.
|
| I would be interested to see if anyone has experienced this run time 7
| error.
|
| But mainly, I would like to know if any one knows what the code is to
equate
| a variable in a vb program to a range or cell in microsoft excea and
vice
| versa
|
| Thanks for your interest!
|
|
| "Randy Birch" <rg************@mvps.org> wrote in message
| news:0_********************@rogers.com...
| > Does your VB application use the VBA Forms 2.0 controls? These are
not
| > supported under VB, and will generate that error. The fix is to not
use
| > these controls.
| >
| > Do you use the data combo control along with its boundtext property?
This
| > will throw an error if the list is scrolled to view additional
items.
| There
| > is no fix.
| >
| > How long are the strings assigned to the array members (I'm
presuming the
| > array is defined as string, and not as a numeric data type). If
| significant,
| > remember that when you redim preserve VB creates a new array then
copies
| the
| > current array into it. This requires double the memory while these
two
| > arrays are alive.
| >
| > What is code where the error occurs, and on which specific line?
Include
| > declares and sample data.
| >
| > --
| >
| >
| > Randy Birch
| > MS MVP Visual Basic
| >
http://vbnet.mvps.org/
| >
| >
| > "Tmenke" <me*****@netscape.net> wrote in message
| > news:1M***************@fe40.usenetserver.com...
| > : Hello,
| > :
| > : I was wondering if anyone can help. I wrote a program in VBA. It
does
| some
| > : calculations with matrices (arrays) . These arrays are dynamic and
are
| > sized
| > : according to a user defined input. The program works great when
woriking
| > : with a small number but as the number increases (estimate about a
50 x
| 50
| > : array) the program will give a runtime error 7 message "Out of
memory".
| 50
| > x
| > : 50 array does not seem like a lot and when I looked into the help
there
| > was
| > : a mention of a 64k segment boundary. I'm not sure what this is,
can
| anyone
| > : help explain this ?
| > :
| > : I was thinking this may be a limitation with running VBA on excel
and
| > wanted
| > : to compile a stand alone executable program that will take the
data
| placed
| > : in excel cell and do all the number crunching in the program. I
was
| hoping
| > : someone could help me with the syntax to set a constant in a VB
program
| > and
| > : set it equal to a cell or range in an excel spreadsheet (one that
is
| open,
| > : if this matters) and then write data to an excel range after
| calculations
| > : have been done.
| > :
| > :
| > : Thanks
| > :
| > :
| > :
| >
|
|
|