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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel userForm out of memory

Status
Not open for further replies.

Pekka

Technical User
Mar 19, 2002
107
FI
Hi,
I have excel workbook with 3 user forms. Usually forms work as they should but if I leave the workbook open and then try to open form I get the error: Out of memory run-time error 7. Does anybody have any hint how can I avoid this memory lack?
 
Could be that you are not resetting your variables. Especially if you have object or Variant type variables which are not set to Nothing, memory can be eaten away

eg

Dim ws as worksheet
set ws = worksheets(1)
'do stuff
'do stuff

If you stop here, excel doesn't reallocate the memory saved for the ws variable. To clear this, use

set ws = nothing

after you have finished using the variable

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top