Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
End routine by clicking 'X' on Userform
Hello,
I have a routine which calls a Userform. On the userform someone can make a choice. After that the routine continues. But I want to stop the complete routine if someone clicks on the 'X' at the right corner. How to? Exit sub won't work this only stops the userform and the main routine still continues. Arnie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
End routine by clicking 'X' on Userform
Click on the userform and select view code; from the dropdow box on the code
section select Userform, then from the events dropdow select Terminate You will get the following: Private Sub UserForm_Terminate() End Sub Type End in between the Sub and end Sub instructions If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Arnie" wrote: Hello, I have a routine which calls a Userform. On the userform someone can make a choice. After that the routine continues. But I want to stop the complete routine if someone clicks on the 'X' at the right corner. How to? Exit sub won't work this only stops the userform and the main routine still continues. Arnie |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
End routine by clicking 'X' on Userform
Thanx!
"Michael" schreef in bericht ... Click on the userform and select view code; from the dropdow box on the code section select Userform, then from the events dropdow select Terminate You will get the following: Private Sub UserForm_Terminate() End Sub Type End in between the Sub and end Sub instructions If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Arnie" wrote: Hello, I have a routine which calls a Userform. On the userform someone can make a choice. After that the routine continues. But I want to stop the complete routine if someone clicks on the 'X' at the right corner. How to? Exit sub won't work this only stops the userform and the main routine still continues. Arnie |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
End routine by clicking 'X' on Userform
Never use the 'End' statement.
Look at the QueryClose Event in the Userform and help. If still not sure how to terminate your app cleanly describe what is running, eg code returns to the routine that show'd a Modal Userform, other forms still running, etc. Regards, Peter T "Arnie" wrote in message el.net... Thanx! "Michael" schreef in bericht ... Click on the userform and select view code; from the dropdow box on the code section select Userform, then from the events dropdow select Terminate You will get the following: Private Sub UserForm_Terminate() End Sub Type End in between the Sub and end Sub instructions If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Arnie" wrote: Hello, I have a routine which calls a Userform. On the userform someone can make a choice. After that the routine continues. But I want to stop the complete routine if someone clicks on the 'X' at the right corner. How to? Exit sub won't work this only stops the userform and the main routine still continues. Arnie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Font Issues when using UserForm box after clicking a Checkbox | Excel Discussion (Misc queries) | |||
How do I continue a routine while showing a userform? | Excel Programming | |||
Excel 2000 Load Userform when clicking cell | Excel Programming | |||
Clicking on a cell to execute a routine | Excel Programming | |||
Keep userform visible, but return control to calling routine | Excel Programming |