Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lack of memory during execution of a macro.

Status
Not open for further replies.

dubotho

Programmer
Mar 20, 2000
4
DE
When I run my macro, there is an error of lack of memory during execution. I create a lot of sheet containing a lot of graphs. (it stopped on the 60th graphs).

Is there something to do to erase the memory or something like this. I use a lot of sub, variables, dynamic array...

Thanks.
 
One way I can think of is terminating arrays, strings, variants and objects after they have been used. For arrays, use the Erase <array-name-here> command, for strings, you can set them to null e.g strExample = &quot;&quot; and for variants and objects, you can set them to nothing e.g Set rangeExample = Nothing.

If you reduce the amount of global variables and dynamic arrays you use, this will also help. I'm certainly no expert, but check out this site for how to write leaner, meaner code:
Also look at this site: the section on variables has a good explanation on declaring & using variables.

As for the graphs, can't help you there, but I did write a macro to populate an excel spreadsheet with lots of charts with no problem. There were at least 100, it was slow but no other problems.

Hope this helps. Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top