Jul 21 2022 07:32 AM
So been having this problem where my code wasn't being saved once i exited the workbook or excel. then it dawned on me to create a proc that used OnTime to run every second and check to see if EnableEvents was turned off. if it was, then it prints a line to the immediate window, it turns it back on and then the proc Stops and I can check the Call Stack (which only shows the OnTime proc).
I can confirm that I am running no other OnTime procs, that I am not running any other proc (at the time) and can watch the immediate window state that EnableEvents was turned off. No rhyme or reason as to when this happens.
Here is my code that runs in the AddinLoader (the only addin that is currently turned on) to check for EnableEvents. I am thinking that maybe my Office installation needs to be redone. Thoughts?
Sub CheckEnableStatus()
If Application.EnableEvents = False Then
Debug.Print "Enable was turned off"
Stop 'check call stack
End If
Application.EnableEvents = True
UCheckEnable.lbl_Status = Application.EnableEvents
Application.OnTime Now + TimeValue("00:00:01"), "CheckEnableStatus"
End Sub
Jul 21 2022 08:13 AM
Jul 21 2022 11:04 AM
SolutionJul 21 2022 11:04 AM
Solution