![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 49
|
Hi guys..
Say I have a macro XX running... & I have a useform with a Stop Macro command button. How, if its possible, to stop XX using the cmdbutton_click() event handler?? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
Would something like this do the trick?
Private Sub CancelButton1_Click() Userform1.Hide End End Sub Rgds AJ |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
End can be dangerous.
To stop a seperate process, use a Global flag. Place a line in such as this... If ExitNow Then Exit Sub Assign the boolean ExitNow as True with your commandbutton. Tom |
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 49
|
Gotcha... thanks... so basically I will modify XX to check the global variable upon entry, exit or mid-way or something right??
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Correct
Dim Public in standard mod |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|