Forum Discussion
Application.EnableEvents is getting turned off by some rogue process
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
- Turns out it was one of the commercial addins. emailed the founder and am awaiting instructions. going to close this as i know what is causing the issue.
2 Replies
- DanMcGBrass Contributorso one quick note, i changed the print line to this: Debug.Print "Enable was turned off at " & Format(Now, "hh:nn:ss")
and can see where this is being turned off every 5 minutes (to the second). so one of my commercial addins is probably doing this. will start by disabling both addins (MZTools and AutoMacro) and then maybe Rubberduck once that is done. but getting closer to the Why question being answered.- DanMcGBrass ContributorTurns out it was one of the commercial addins. emailed the founder and am awaiting instructions. going to close this as i know what is causing the issue.