XL97: Data Validation Message May Not Disappear

Last reviewed: February 27, 1998
Article ID: Q173417
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

After a data validation input message appears for a cell, the message may not disappear when you select another cell.

CAUSE

This problem occurs if both of the following conditions are true:

  • An OnKey Visual Basic for Applications procedure is in memory.

        -and-
    
  • The OnKey procedure selects a cell other than the active cell.

RESOLUTION

To resolve this problem, click any cell in the active worksheet.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/

Example

The following steps demonstrate the problem:

  1. Save and close any open workbooks, and then create a new workbook.

  2. Select cell A1, and then click Validation on the Data menu.

  3. On the Input Message tab, enter any text in the Input Message box, and then click OK.

  4. Press ALT+F11 to start the Visual Basic Editor.

  5. On the Insert menu click Module.

  6. Enter the following code in the module:

           Sub test()
              Application.OnKey "~", "test2"
           End Sub
    
           Sub test2()
              Range("c1").Select
           End Sub
    
    

  7. Run the test procedure.

    When you type data in a cell and press ENTER, the test2 procedure automatically runs.

  8. Press ALT+F11 to switch to Microsoft Excel.

  9. Select cell A1.

    The input message you typed in step 3 is displayed next to cell A1.

    NOTE: The input message is displayed by the Office Assistant if the Office Assistant is visible.

  10. Type any text, and then press Enter.

Cell C1 is selected and the input message for cell A1 is still visible.

REFERENCES

For more information about OnKey macros, click the Office Assistant in the Visual Basic Editor, type "onkey," click Search, and then click to view "OnKey Method."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q120802
   TITLE     : Office: How to Add/Remove a Single Office
               Program or Component


Additional query words: XL97
Keywords : kbcode kbprg xlvbainfo xlui
Version : WINDOWS:97
Platform : WINDOWS


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