Expand description
The macro debugger: a run that stops between steps.
macro.debug starts a run that pauses before its first step, then steps, continues to the next
breakpoint, runs to a chosen step, or stops. The run lives on the session between calls (one
action per call) inside an undo group that spans them; Stop keeps the changes as one undo step
or rolls them back. While a macro is being debugged its workbook is locked: only the
debugger, queries and the commands in LOOKS_AROUND run there, and everything else, saving
included, is refused (“Finish or stop the macro first”). Other workbooks stay editable. The
debugger runs on its own, never as a step of a script or macro, and is never recorded.
Structs§
- Debugger
- A macro being debugged.
Constants§
- BUSY
- The message for edits refused while a macro is being debugged.
- LOOKS_
AROUND - Commands that run on the debugged workbook between steps, besides
macro.debugand queries. They only look around (the selection, the active sheet, Go To, Find, zoom, copying), switch to another window, close the workbook (which ends the run) or stop the run (Stop Action). The debugger puts the run’s active sheet and selection back before its next step runs. - MAX_
BREAKPOINTS - The most breakpoints one call sets.
Functions§
- debug
macro.debug {name?, inputs?, action: start|step|continue|runTo|stop|state, step?, keep?, breakpoints?, breakpointsOnly?}.- runs_
while_ locked - Whether command
id(a query whenquery) runs on a workbook the debugger locks.