I just put a breakpoint on End Sub, went alt-R,R, and now MyGlobalString is "" whereas had I instead gone F5 or F8 it would be "foo" as assigned earlier. (The variable was defined atop the module, public MyGlobalString as string) Also, a form control's value that normally would persist when I .Show'd the form again is lost by breaking and ending code.
Are there other implications of terminating code? I always thought that all I had to worry about was restoring states like Calculation mode and closing things that obviously need to be closed. What else happens?
( And while I'm thinking about it, I wonder which "state" variables do I really need to worry about restoring anyway? I seem to observe that some always return to normal regardless of how code ends (.ScreenUpdating) and some don't (.Calculation). )
I do note on https://msdn.microsoft.com/en-us/vba...tart-execution
"You can restart execution from break mode. Restarting returns the code to a newly initialized state, resetting all variables and removing any suspendedprocedures from memory." (By "restarting" it means to restart code by alt-R, R and then running code again)
Bookmarks