D
Dan
Hi,
I need to run a process repeatively, but I need to be able to stop it too or
change the timing , but keep getting the following error when trying to stop
the process " Run-Time error '1004': Method 'ONTIME' of Object 'Application'
Failed"
Any idea why, or how I should do it instead.
Many thanks
Sub RunMacro()
Application.OnTime Now + TimeValue("00:00:05"), "OnTimeMacro"
End Sub
Sub OntimeMacro()
MsgBox "hello"
RunMacro
End Sub
Sub byebye()
Application.OnTime EarliestTime:=TimeValue("00:00:05"),
Procedure:="my_Procedure", Schedule:=False ' this is where I keep getting the
error?
MsgBox "Bye Bye"
End Sub
I need to run a process repeatively, but I need to be able to stop it too or
change the timing , but keep getting the following error when trying to stop
the process " Run-Time error '1004': Method 'ONTIME' of Object 'Application'
Failed"
Any idea why, or how I should do it instead.
Many thanks
Sub RunMacro()
Application.OnTime Now + TimeValue("00:00:05"), "OnTimeMacro"
End Sub
Sub OntimeMacro()
MsgBox "hello"
RunMacro
End Sub
Sub byebye()
Application.OnTime EarliestTime:=TimeValue("00:00:05"),
Procedure:="my_Procedure", Schedule:=False ' this is where I keep getting the
error?
MsgBox "Bye Bye"
End Sub