Hi,
Anyone know is there a way of cancelling the termination of a form in VBA? I know theres a cancel event with the unload method of a form in VB6 but not how the same can be done in VBA and I can't find an unload event in VBA.
Thanks.
Printable View
Hi,
Anyone know is there a way of cancelling the termination of a form in VBA? I know theres a cancel event with the unload method of a form in VB6 but not how the same can be done in VBA and I can't find an unload event in VBA.
Thanks.
I was looking for the same answer. I have this macro running a userform which suppose to stay on but when run the second time it terminates the form.
Just Two questions...
1) Are you working in VBA Excel?
2) When you say 'Termination' do you mean the 'Terminate Event' i.e when the user clicks on the Close button?
Yes,
when the user clicks the close button. In the termination VBA code, there's no cancel event. There's no form unload event either. How does one stop the the closing of a form in this case?
Thanks.
Hi,
Actually found a solution to this. Was looking at the wrong event. It's not the termination event I should be looking at, it's the QueryClose event. Please look at the following web-site, which provides a solution to this tricky problem.
http://vb-helper.com/howto_vba_noclose_userform.html
Thanks for all involved for their help.