Code
Sub Refresh() 'This automatically refreshes the time every 10 seconds
Application.OnTime Now + TimeValue("00:00:10"), "refresh"
Application.Calculate
End Sub
Sub StopRefresh()
Application.OnTime Now + TimeValue("00:00:10"), "refresh", False
End Sub
Code
Private Sub Workbook_Open()
Call Refresh
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call StopRefresh
End Sub
I'm not sure why the stop refresh isn't working. Should I use something different? The refresh is essentially just calculating every 10 seconds and I need this to stop when the workbook closes. Thank you.