Application.EnableCancelKey (Excel)

Controls how Microsoft Excel handles Ctrl+Break (or Esc or Command+Period) user interruptions to the running procedure. Possible return values are xlDisabled - Cancel key trapping is completely disabled, xlErrorHandler - The interrupt is sent to the running procedure as an error, trappable by an error handler set up with an On Error GoTo statement. The trappable error code is 18, xlInterrupt - The current procedure is interrupted, and the user can debug or end the procedure.

XlEnableCancelKey can be one of these constants:


Application.EnableCancelKey = xlDisabled