Hi,
I'm trying to figure out how to temporarily disable my macro for like 5 seconds and then have it continue running the rest of the script. I tried using the OnTime function (shown below), but it caused the following error message to pop up "Cannot run the macro 'C:\...\testbook.xlsm'!statuscheck'. The macro may not be available in this workbook or all macros may be disabled."
Any help with this would be much appreciated. Thanks!
I'm trying to figure out how to temporarily disable my macro for like 5 seconds and then have it continue running the rest of the script. I tried using the OnTime function (shown below), but it caused the following error message to pop up "Cannot run the macro 'C:\...\testbook.xlsm'!statuscheck'. The macro may not be available in this workbook or all macros may be disabled."
Code:
Sub test()
Dim i As Integer
For i = 1 To 3
Application.Calculate
Next i
Application.OnTime Now + TimeValue("00:00:05"), "statuscheck"
End sub
Sub statuscheck()
Msgbox "done"
End sub
Any help with this would be much appreciated. Thanks!