Microsoft KB Archive/156892

= Excel Stops After Specifying Conditional Format =

Article ID: 156892

Article Last Modified on 10/10/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q156892



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.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to 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 requirements.

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

 Close all workbooks you currently have open in Microsoft Excel. Open a new workbook. Start Visual Basic Editor (press ALT+F11).  Type the following function into the new module sheet: Function aTest aTest = 1 MsgBox aTest End Function  On the File menu, click "Close and Return to Microsoft Excel."</li> In Sheet1, type 1 in cell A1.</li> With cell A1 selected, click Conditional Formatting on the Format menu.</li> In the Condition 1 list, click "Cell Value Is."</li> In the next list, click "equal to."</li> In the RefEdit box, type =aTest .</li> Click Format. In the Color list, click Red, and then click OK.</li> In the Conditional Formatting dialog box, click OK.</li></ol>

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

<div class="references_section">