Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Releasing all Userforms in memory

VBA provides methods to Hide (which keeps it in memory and
programmatically available) and Unload (which supposedly
removes all traces of the form until it's loaded again)
any given form.

But is there a way to unload any and all forms that are
presently in memory?

Thanks for any input.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Releasing all Userforms in memory

Sub Tester1()
Dim frm As UserForm
Dim frm1 As UserForm1
Dim frm2 As UserForm1
Dim frm3 As UserForm1
Set frm1 = New UserForm1
Set frm2 = New UserForm1
Set frm3 = New UserForm1
Debug.Print UserForms.Count
For Each frm In UserForms
Unload frm
Next
Debug.Print UserForms.Count
End Sub


3
0

is the result.

--
Regards,
Tom Ogilvy




"Rich" wrote in message
...
VBA provides methods to Hide (which keeps it in memory and
programmatically available) and Unload (which supposedly
removes all traces of the form until it's loaded again)
any given form.

But is there a way to unload any and all forms that are
presently in memory?

Thanks for any input.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL 2007 - Out of Memory - memory leak/bug? PCLIVE Excel Discussion (Misc queries) 0 March 23rd 09 03:31 PM
Releasing arrays? SiriS Excel Discussion (Misc queries) 3 December 19th 05 12:46 PM
UserForms soniya Excel Programming 1 April 11th 04 11:14 AM
Question about releasing memory TBA[_2_] Excel Programming 2 January 20th 04 04:24 AM
The instruction at "0x65255ac9" referenced memory at "0x00000008". The memory could not be read. Clikc OK to terminate etc Angus Comber[_2_] Excel Programming 1 November 7th 03 01:18 PM


All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"