I have a macro for a count down timer that works fine until I open another excel file. I get the debug error message. Can anyone help me with my code so this does not happen? I attached a pic of the line that Excel highlights when I open a new excel file and then I also pasted my timer code. Thanks 
Dim gCount As Date
'Updateby20140925
Sub Timer()
gCount = Now + TimeValue("00:00:01")
Application.OnTime gCount, "ResetTime"
End Sub
Sub ResetTime()
Dim xRng As Range
Set xRng = Application.ActiveSheet.Range("E1")
xRng.Value = xRng.Value - TimeSerial(0, 0, 1)
If xRng.Value <= 0 Then
MsgBox "Countdown complete."
Exit Sub
End If
Call Timer
End Sub
Bookmarks