I have a modal userform that I use the queryunload event to trap the user clicking the userform close button.

I trap it using

If CloseMode = vbFormControlMenu Then

and display a different modal userform that gives an option to close the workbook (programmatically) or return (via command button) to the previous userform.



I'm finding that whether I unload the first userform or not after passing through the queryunload event; when I return to the first userform all is well except that clicking the userform close button doesn't do anything anymore.

I'm also finding that whether I do

If CloseMode = vbFormControlMenu Then
Cancel = True

or whether I leave out the Cancel = True, the result is the same. I can leave the first userform, navigate to the next userform, but when I come back to the first userform, I can no longer use the userform close button for anything.


Anybody know what I'm doing wrong? Does this make sense?