URGENT - Visual Basic Out of Memory

S

sgl

Hi All!

I have developed an application of approx 3.5mb.Quite a
lot of VBA code and a lot of graphics, mainly forms that
need to be completted by the user. Lately I have been
unable to work on the prog as after a few minutes work i
keep getting a message ... "Microsoft Visual basic - Out
of memory". Excel has to be closed down. Impossible to
load a second workbook. This problem has been acquired
lately. The wkb has not altered substantially in size for
many months. When Excel is loaded system rsources meter
shows approx 64% available. Once XL application loaded
system resources goes down to 9% available. I increased
the memory from the original 128 mb to 256 mb still the
same problem.

I use an IBM ThinkPad 600x with 256mb memory using Windows
98 and Excel 2000.

Thanks in adavnce
 
S

shockley

Use the Windows System Monitor application to see how much "Free Memory" you
have. Find it in Programs/Accessories, or if not loaded you may have to
load it from the CD. It is "sysmon.exe" in the Windows folder. If Free
Memory is below a couple MB you probably have a memory problem. 256MB
should be enough unless your graphics files are huge. But Win98 can leak
memory badly. You can watch System Monitor while your application runs to
see how Free Memory is being used. You might want to consider moving up to
an NT based OS like Win2K or WinXP which are much better about managing
memory.

HTH,
Shockley
 
P

Philip Mariconda

The only possibility I can think of is object cleanup. If
you declare any object variable (i.e. variant, workbook,
range,) each one takes a fair chunk of memory. When it is
no longer needed, do the following:

Set Variable = Nothing

That frees up a little memory. If you have enough of
those, it could certainly add up.

This may also be related to the graphics, which can eat up
a ton of memory. I don't have any other ideas there
except maybe to reduce the resolution or number of colors
where you can.

Good luck with that,
Phil
 

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