Hi everyone.
Sorry if this has been asked again. Took a look but didnt find anything that swits me.
I want to run the same macro every 5 sec. So,
after the requirments are met the macro "CurrentMacro" is fired. It is:
Sub LayFormulaMacro1()
'
' my code here, some if statements for exit sub and a couple of Sheet2!Range(A1)=Sheet1Range(B2)
'
Application.OnTime Now() + TimeValue("00:00:05"), "CurrentMacro"
but it fails and gives me the error:
Run-time error '1004'
Method 'OnTime' of object'_Application' failed
I press the end button at the messege box and then the 'Run Sub' button (bassically i run manually the macro) and now the macro works fine.
Dont get it , why it fails first place?
Debugger highlights the row "Application.OnTime ......."
Sorry if this has been asked again. Took a look but didnt find anything that swits me.
I want to run the same macro every 5 sec. So,
after the requirments are met the macro "CurrentMacro" is fired. It is:
Sub LayFormulaMacro1()
'
' my code here, some if statements for exit sub and a couple of Sheet2!Range(A1)=Sheet1Range(B2)
'
Application.OnTime Now() + TimeValue("00:00:05"), "CurrentMacro"
but it fails and gives me the error:
Run-time error '1004'
Method 'OnTime' of object'_Application' failed
I press the end button at the messege box and then the 'Run Sub' button (bassically i run manually the macro) and now the macro works fine.
Dont get it , why it fails first place?
Debugger highlights the row "Application.OnTime ......."