Name

Application.EnableCancelKey [= XlEnableCancelKey]

Synopsis

Sets or returns how Excel handles the Esc, Ctrl-Break, and Command-Period (Macintosh) keys. Can be one of these settings:

xlDisabled

Cancel key trapping disabled.

xlErrorHandler

Cancel key causes error 18, which can be trapped by an On Error statement.

xlInterrupt

Cancel interrupts the current procedure, and the user can debug or end it (default).

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.