XL: Excel Stops After Specifying Conditional Format

Last reviewed: March 13, 1998
Article ID: Q156892
The information in this article applies to:
  • Microsoft Excel 97 for Windows
  • Microsoft Excel 98 Macintosh Edition

SYMPTOMS

When you specify a conditional format that refers to a user-defined function, the Microsoft Excel screen may stop updating or may be redrawn incorrectly, or Microsoft Excel may stop responding.

CAUSE

This problem may occur when both of the following conditions are true:

  • You created a user-defined function that displays a message box.

        -and-
    
  • You specified a conditional format that refers to the user-defined function you created.

WORKAROUND

To get your screen to refresh correctly, save and close the workbook. If the screen does not update correctly after closing the workbook, follow these steps:

  1. Quit Microsoft Excel.

  2. Open the workbook.

  3. Remove the conditional formatting that refers to the user-defined function.

  4. Save the workbook.

NOTE: In some cases, simply removing the message box from the function may work as expected.

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/support/supportnet/refguide/default.asp

Steps to Reproduce Problem

The following example creates a user-defined function and a conditional format that refers to this function.

  1. Close all workbooks you currently have open in Microsoft Excel.

  2. Open a new workbook.

  3. Start Visual Basic Editor (press ALT+F11).

  4. Type the following function into the new module sheet:

    Function aTest()

              aTest = 1
              MsgBox aTest
           End Function
    
    

  5. On the File menu, click "Close and Return to Microsoft Excel."

  6. In Sheet1, type "1" (without the quotation marks) in cell A1.

  7. With cell A1 selected, click Conditional Formatting on the Format menu.

  8. In the Condition 1 list, click "Cell Value Is."

  9. In the next list, click "equal to."

  10. In the RefEdit box, type "=aTest()" (without the quotation marks).

  11. Click Format. In the Color list, click Red, and then click OK.

  12. In the Conditional Formatting dialog box, click OK.

The message box appears several times, and the screen stops updating the display. However, menus are still available.

REFERENCES

For more information about conditional formatting, click the Index tab in Microsoft Excel Help, type the following text

   conditional formats

and then double-click the selected text to go to the "Highlight data that meets conditions you specify" topic.

For additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q163435
   TITLE     : VBA: Programming Resources for Visual Basic for
               Applications


Additional query words: XL97 XL98 8.00 hang hangs lock crash crashes freeze
freezes
Keywords : kbcode kbenv kbprg xlui xlformat kbfaq
Version : WINDOWS:97; MACINTOSH:98
Platform : MACINTOSH WINDOWS
Issue type : kbbug
Solution Type : kbworkaround


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