VBA "Out of Memory" message


Posted by Paul Magruder on March 23, 2001 10:54 AM


I have a workbook that has 14 Userforms in it. I am using Excel 97 with Windows NT. The problem is when I go to close the workbook I get a error message "Microsoft Visual Basic, Out of Memory"(error 7). Is the problem in the code I wrote? It looks like each Userform has its own window open in the VBA window (behind each other). Is this correct? Can it be the cause of the problem? Thanks in advance.......Paul



Posted by David Hawley on March 23, 2001 8:24 PM

Hi Paul

My guess would be that you are only hiding each UserForm instead of Unloading them. Hiding a UserForm still leaves it in memory. Use the code:

Unload Me

Or

Unload UserForm1

For each UserForm instead of Me.Hide or UserForm1.Hide

Dave
OzGrid Business Applications