DocErr: EnableCancelKey Property Uses xlDisabled Constant

Last reviewed: December 1, 1997
Article ID: Q149252
The information in this article applies to:
  • Microsoft Excel for Windows 95, version 7.0, 7.0a
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SYMPTOMS

The following two paragraphs about Microsoft Excel can be found on page 187 of the Microsoft Excel "Visual Basic User's Guide" and page 137 of "Microsoft Excel/Visual Basic Programmer's Guide":

   You can also ignore user interrupts completely by setting the
   EnableCancelKey property to xlIgnore. In this condition, Microsoft
   Excel ignores all attempts by the user to interrupt the running
   procedure.

   Note  Use caution when disabling or ignoring user interrupts. It is
   possible to write code that never returns or ends. If you disable
   interrupts by setting the EnableCancelKey property to xlIgnore, or if
   you always use the Resume statement to return from a trapped error,
   your procedure will not return control to the user.

MORE INFORMATION

These statements are incorrect. To make the statements correct, replace every instance of the word "xlIgnore" with the word "xlDisabled". The constant xlDisabled is referred to in Visual Basic online Help.

For additional information, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q146864
   TITLE     : Error Trapping with Visual Basic for Applications

   ARTICLE-ID: Q79488
   TITLE     : Excel: ON.KEY Does Not Disable Macro Interruption
               with ESC Key

REFERENCES

"Microsoft Excel/Visual Basic Programmer's Guide," p.136-138, Microsoft Press, 1995.

Microsoft Excel "Visual Basic User's Guide," version 5.0, p. 186-187.

For more information about the EnableCancelKey method in Microsoft Excel version 7.0, click Answer Wizard on the Help menu and type:

   EnableCancelKey

For more information about Error Handling in Microsoft Excel version 5.0, click the Search button in Help and type:

   Error Trapping


Additional query words: 5.00 5.00a 5.00c 7.00 5.0 5.0c 5.00c XL7 XL5
Keywords : kbprg PgmOthr
Version : WINDOWS:5.x,7.0,7.0a; MACINTOSH:5.0,5.0a
Platform : MACINTOSH WINDOWS
Issue type : kbdocerr
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.