Up until a few years ago (don't remember which version of Office/EXCEL it was) I was able to break long-running (or in infinite loop) VBA code by pressing CTRL-BREAK, if the code was performing Input/output. But this is no longer working in EXCEL 2016. Running the following code:
Public Sub doit()
While 1 = 1
Debug.Print Now()
Wend
End Sub
Runs for a while, printing (I/O) the current date-time on the immediate window (it can be interrupted at this point), but after a few seconds EXCEL goes into 'Not Responding' mode, and never recovers (the only option is to End the program; loosing data/coding to last Autorecover point).
Does anyone know why? and if there is a way to break the code while in that Not Responding mode? Is sprinkling DoEvents all over the code the only way to guarantee that we can break?
This is 32 bit EXCEL.