DISABLE.INPUT Disables ON.KEY Command in Excel

Last reviewed: November 2, 1994
Article ID: Q75179

SUMMARY

The DISABLE.INPUT macro command functions differently in Microsoft Excel 3.0 for Windows than it does in Excel versions 2.x. The difference occurs when the ON.KEY command is executed following the DISABLE.INPUT command.

MORE INFORMATION

The DISABLE.INPUT blocks all input from the keyboard and mouse to Excel. The ON.KEY command runs a specified macro when a particular key or key combination is pressed. If a DISABLE.INPUT(TRUE) command is followed by an ON.KEY command in Excel 2.x, the ON.KEY command functions properly. In Excel 3.0, the ON.KEY command is ignored.

Example

  1. Enter the following data into a macro sheet:

          A1:  Main_Macro
          A2:  =ERROR(0)
          A3:  =ECHO(1)
          A4:  =DISABLE.INPUT(1)
          A5:  =ON.KEY("{RIGHT}","Macro1.xlm!Test")
          A6:  =RETURN()
          A7:
          A8:  Test
          A9:  =DISABLE.INPUT(0)
          A10: =RETURN()
    

  2. In Excel 2.x, run Main_Macro. You will now be unable to type anything at the keyboard or select anything with your mouse.

  3. Press the RIGHT ARROW key.

    Note that pressing the RIGHT ARROW key returns control of the keyboard and mouse.

  4. Follow steps 2 and 3 in Excel 3.0.

Note that you are not given back control of the keyboard and mouse.

REFERENCES

"Microsoft Excel Function Reference," version 3.0, pages 58, 165

"Microsoft Excel Functions and Macros," version 2.x, pages 271, 321


KBCategory: kbother
KBSubcategory:

Additional reference words: noupd


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: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.