Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Issues when using UserForm box after clicking a Checkbox RobGolf72 Excel Discussion (Misc queries) 1 October 9th 07 07:51 PM
How do I continue a routine while showing a userform? Rubble Excel Programming 1 July 2nd 07 10:26 PM
Excel 2000 Load Userform when clicking cell scain2004[_3_] Excel Programming 8 May 2nd 04 04:10 AM
Clicking on a cell to execute a routine Mark Excel Programming 2 January 27th 04 12:20 PM
Keep userform visible, but return control to calling routine Ryan Poth[_2_] Excel Programming 0 August 21st 03 05:28 AM


All times are GMT +1. The time now is 09:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"