+ Reply to Thread
Results 1 to 5 of 5

Form not terminating

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Form not terminating

    When I run this sub, frmModalessForm.Terminate() is not executing. Why not?
    Please Login or Register  to view this content.
    If I "Unload oForm" then it executes, but why not when it's set to Nothing?
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Form not terminating

    Hi foxguy,

    Searching on VBA Excel Userform Show Hide Unload Terminate gave me:
    http://support.microsoft.com/kb/829070

    It claims "The Terminate event occurs after the UserForm is removed from memory".

    I wonder if you can't terminate because it needs to still be in memroy by some other instruction?
    http://msdn.microsoft.com/en-us/library/gg251819.aspx Using 2010?

    http://msdn.microsoft.com/en-us/libr...ffice.10).aspx got a RefEdit control on the form?

    I'm clueless!!
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Form not terminating

    I guess that's what I'm asking.

    Why doesn't "Set oForm = Nothing" remove the form from memory ?
    Why do I have to use "Unload oForm" ?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Form not terminating

    Setting it to Nothing releases the object variable, it doesn't affect the object.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Form not terminating

    Does that mean that a form does not have any scope when I assign it to a variable? It would still exist in memory when the sub that creates it ends?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1