Hi, please can someone help me?
I keep getting the following error:
Run time error 1004 - Method 'OnTime' of object'_Application' failed.
It keeps popping up quite often but from different situations on my file but it doesn't always happen when i repeat a certain situation.
Here is all the workbook code
The offending line is in red.
Any help would be much appreciated.
Kind Regards
Dan
I keep getting the following error:
Run time error 1004 - Method 'OnTime' of object'_Application' failed.
It keeps popping up quite often but from different situations on my file but it doesn't always happen when i repeat a certain situation.
Here is all the workbook code
The offending line is in red.
Code:
Option ExplicitConst Timeout As Long = 10 ' 10 minutes
Private Sub Workbook_Open()
Application.OnTime TimeValue("02:00:00"), "sveWrkBk" '<-- change time to save here hh:mm:ss
dTime = Time
On Error Resume Next
Application.OnTime dTime + TimeSerial(0, Timeout, 0), "CloseMe"
On Error GoTo 0
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
[COLOR=#ff0000]Application.OnTime dTime + TimeSerial(0, Timeout, 0), "CloseMe", , False[/COLOR]
dTime = Time
Application.OnTime dTime + TimeSerial(0, Timeout, 0), "CloseMe"
On Error GoTo 0
End Sub
Any help would be much appreciated.
Kind Regards
Dan