Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping an animation macro
I have an animation macro that loops for a while. How
would I be able to have the user press a key and gracefully stop the macro from running? Thanks in advance Ray |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping an animation macro
Hi Ray
Post your code -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ray Kanner" wrote in message ... I have an animation macro that loops for a while. How would I be able to have the user press a key and gracefully stop the macro from running? Thanks in advance Ray |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping an animation macro
Here is the code
Private Sub Animate_Click() Dim n As Integer, i As Integer, Response As Integer Dim SWWidth As Variant Application.ScreenUpdating = True SWWidth = Range("ScrollWindow").Value If SWWidth = 0 Or Not IsNumeric(SWWidth) Then Beep Range("ScrollWindow").Select MsgBox "Scroll Window must be numeric greater than 0" Exit Sub End If n = Range("AnimateLoop").Value For i = 1 To n Call spinWindow_SpinUp Application.Wait (Now + TimeSerial(0, 0, Range ("WaitTime").Value)) Next i End Sub -----Original Message----- Hi Ray Post your code -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ray Kanner" wrote in message ... I have an animation macro that loops for a while. How would I be able to have the user press a key and gracefully stop the macro from running? Thanks in advance Ray . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping an animation macro
Sorry the last post was incomplete. SpinWindow is a spin
control that changes the dates on a chart so that the animation macro loops through a chart n times using different time periods. Thanks Ray Kanner Private Sub Animate_Click() Dim n As Integer, i As Integer, Response As Integer Dim SWWidth As Variant Application.ScreenUpdating = True SWWidth = Range("ScrollWindow").Value If SWWidth = 0 Or Not IsNumeric(SWWidth) Then Beep Range("ScrollWindow").Select MsgBox "Scroll Window must be numeric greater than 0" Exit Sub End If n = Range("AnimateLoop").Value For i = 1 To n Call spinWindow_SpinUp Application.Wait (Now + TimeSerial(0, 0, Range ("WaitTime").Value)) Next i End Sub -----Original Message----- Hi Ray Post your code -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ray Kanner" wrote in message ... I have an animation macro that loops for a while. How would I be able to have the user press a key and gracefully stop the macro from running? Thanks in advance Ray . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect macro from stopping | Excel Discussion (Misc queries) | |||
Animation | New Users to Excel | |||
Stopping Excel macro pattern recgonition | New Users to Excel | |||
My Macro keeps stopping?? | Excel Programming | |||
Stopping a macro without using Ctrl Break | Excel Programming |