I\'ve run into this error when trying to make a stopwatch timer in Excel. Here\'s a simple test code. Create an empty Excel workbook with a button. And assign a macro to it:
I was able to solve it with
On Error Resume Next
at the beginning of TimerProc. Some more (in Russian) or less related links.
Or probably even better:
Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, ByVal nIDEvent As Long, ByVal dwTimer As Long)
On Error GoTo BeforeExit
Range("A1") = "test"
BeforeExit:
End Sub