I have a code that acts as a countdown timer(up to three timers on one sheet), and several actions occur while the timer is active. Everything is working fine right now. When any of the timers hit 0 the following snippet of code is run:
If Sheets("Sheet1").Range("C8").Interior.Color = 255 Or Sheets("Sheet1").Range("G8").Interior.Color = 255 Or Sheets("Sheet1").Range("K8").Interior.Color = 255 Then
Beep
Application.Speech.Speak ("Part is done")
Beep
Call AlertTIMER
Else
Exit Sub
End If
The AlertTIMER
sub that is called from the snippet above runs Application.Wait
, creating a 3 second pause between when it was last called and when it can be called next. The reason I have included the wait function is because while Application.Speech
is running I'm unable to complete any other actions (such as clicking the "Stop" command button which terminates the Alert sub).
Is there a way to allow command buttons to be pressed while Application.Speech is active so I can remove the Application.Wait function? Or do I need to keep my workaround of Application.Wait?
I have tried using DoEvents
by placing it before the first beep but it did not work.
application.speech.speak
while executing, You can ctrl+break. – RaystafarianApplication.Wait
). This pause allows for someone to click a commandbutton (Stop) which will cause the Alert Sub to stop being triggered. If they don't, then after the 3 seconds have expired, the Alert sub is called again. If I do not include the pause (which Ideally I would like to remove) , then it is impossible to click the commandbutton (stop) while the Alert sub is active. I'm looking for a way to be able to execute actions while the sub Alert is active (Beep "Part is done" Beep). – Dimitri M