I have a timer within Excel VBA code which did run smooth untill 6 weeks ago. Please see the code below. I use this timer in a workbook. I use 2 identical copies of this workbook (with different names). I run these 2 workbooks in 2 separate instances of Excel (using Windows11-button > Run > excel /x > Enter) on my workstation. Next I run the code below in both workbooks. This always functioned perfectly: updating the clock every second in cell K1.
Since 6 weeks ago the code skips a few seconds now and then: jumping from 20:15:00 to 20:15:07 for example instead of 20:15:01. This happens specifically if I run 2 workbooks. Running 1 workbook is still running smooth.
Sub UPDATECLOCK()
ThisWorkbook.Sheets(1).Range("K1") = Time
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "UPDATECLOCK"
End Sub
Sub StopClock()
On Error Resume Next
Application.OnTime NextTick, "updateclock", , False
Stop
End Sub
My workstation has enough cores and memory to do this simple task. I have also reinstalled an image from 6 months ago. I have updated Office 365. I have switched Personal and Business Office 365. Although I do not succeed to solve the issue.
Any idea what can be the cause and solution for this issue?
Thanks a lot!