Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Stop a Procedure from another procedure

How do you stop a procedure by click another button. I want to be able to
click button2 to stop the procedure being run by button1.

Private Sub button1_Click()
runingProcedure
End Sub

Private Sub button2_Click()
stop runingProcedure
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Stop a Procedure from another procedure

Ayo wrote:
How do you stop a procedure by click another button. I want to be able to
click button2 to stop the procedure being run by button1.

Private Sub button1_Click()
runingProcedure
End Sub

Private Sub button2_Click()
stop runingProcedure
End Sub


One idea:

Add a module-level or global variable that will be set in button2_Click.
Add code to button1_Click to check the state of this variable in one or
more places as needed.

It's also a good idea to add DoEvents tactically in the button1_Click
code to make sure the click event on button2 is captured appropriately.

Also... make sure you do any necessary cleanup in button1_Click so it
exits gracefully.
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
Procedure is too big Frank Situmorang Excel Worksheet Functions 2 May 2nd 07 05:06 AM
VBA Procedure Jeff Excel Discussion (Misc queries) 0 January 20th 06 04:22 PM
Urgent - VBA procedure Jeff Excel Discussion (Misc queries) 1 January 19th 06 02:57 PM
Very Urgent VBA Procedure Jeff Excel Discussion (Misc queries) 0 October 5th 05 05:39 PM


All times are GMT +1. The time now is 01:42 AM.

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"