TAPS_MikeDion
Well-known Member
- Joined
- Aug 14, 2009
- Messages
- 622
- Office Version
- 2011
- Platform
- MacOS
Hi everybody,
Has anyone run into a problem where Unload Me doesn't work? I have a WHOLE lot of code, so I'm hoping to figure this out without having to swamp everyone with a ton of code.
Here's the pieces...
In Userform_Initialize:
zMatch does = False, so it proceeds to the Unload Me line.
It then jumps from the Unload Me line of code to UserForm_QueryClose, which simply calls the CLOSE button code:
Call CommandButton1_Click is the only line of code in UserForm_QueryClose.
In CommandButton1_Click, the very first line is:
Initializing is True, so it exits CommandButton1_Click and returns to Userform_Initialize. However, after it returns it continues on to the next line of code (which is End If) instead of unloading the form. It then continues through the remainder of the Userform_Initialize code.
Any ideas???
Thanks!
-Mike
Has anyone run into a problem where Unload Me doesn't work? I have a WHOLE lot of code, so I'm hoping to figure this out without having to swamp everyone with a ton of code.
Here's the pieces...
In Userform_Initialize:
Code:
If Not zMatch Then
Application.ScreenUpdating = True
Unload Me
End If
zMatch does = False, so it proceeds to the Unload Me line.
It then jumps from the Unload Me line of code to UserForm_QueryClose, which simply calls the CLOSE button code:
Code:
Call CommandButton1_Click
Call CommandButton1_Click is the only line of code in UserForm_QueryClose.
In CommandButton1_Click, the very first line is:
Code:
If Initializing Then Exit Sub
Initializing is True, so it exits CommandButton1_Click and returns to Userform_Initialize. However, after it returns it continues on to the next line of code (which is End If) instead of unloading the form. It then continues through the remainder of the Userform_Initialize code.
Any ideas???
Thanks!
-Mike