Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
2nd post please help
In a form I put a commmandbutton with cancel and default=true so when the program is running I could stop the execution, but it does not work, I try click and mouse-up subs. It only works after the code has finish executing. What am I doing wrong? Can you give me an example of how can I accomplish this task? Thanks in advance Al .. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Al,
Your code is executing, and during execution, you click on the Cancel button. Your form is responding to events in the sequence in which they occur. Check out the DOEVENTS function. Steve "al" wrote in message ... 2nd post please help In a form I put a commmandbutton with cancel and default=true so when the program is running I could stop the execution, but it does not work, I try click and mouse-up subs. It only works after the code has finish executing. What am I doing wrong? Can you give me an example of how can I accomplish this task? Thanks in advance Al . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is your code doing that you want to cancel? Is it looping over a range
of values? It would help if you would post an example. "al" wrote in message ... 2nd post please help In a form I put a commmandbutton with cancel and default=true so when the program is running I could stop the execution, but it does not work, I try click and mouse-up subs. It only works after the code has finish executing. What am I doing wrong? Can you give me an example of how can I accomplish this task? Thanks in advance Al . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Create a form with two buttons and drop this into its code module.
Option Explicit Private mCancel As Boolean Private Sub CommandButton1_Click() Dim n Me.MousePointer = fmMousePointerHourGlass For n = 1 To 10000 'long running process Debug.Print n DoEvents If mCancel = True Then Exit For Next n mCancel = False Me.MousePointer = fmMousePointerDefault End Sub Private Sub CommandButton2_Click() mCancel = True End Sub Private Sub UserForm_Initialize() mCancel = False End Sub "al" wrote in message ... 2nd post please help In a form I put a commmandbutton with cancel and default=true so when the program is running I could stop the execution, but it does not work, I try click and mouse-up subs. It only works after the code has finish executing. What am I doing wrong? Can you give me an example of how can I accomplish this task? Thanks in advance Al . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stop window saying code execution interrupted at startup? | Excel Discussion (Misc queries) | |||
AUTOMATIC EXECUTION | Excel Discussion (Misc queries) | |||
stop code execution with button | Excel Programming | |||
Execution Error | Excel Programming | |||
stop code execution | Excel Programming |