XL97: RefEdit Control Still Appears After You Close UserFormLast reviewed: March 13, 1998Article ID: Q177632 |
The information in this article applies to:
SYMPTOMSWhen you close a Microsoft Excel custom dialog box (UserForm), the RefEdit control of the UserForm may continue to appear in the foreground of the worksheet and any selected ranges of cells have a marquee around them. If there is a TextBox control on the form, any text typed while the insertion point is active in the TextBox control appears in the RefEdit control. Microsoft Excel cannot be closed and no menus are available, although you can still select ranges of cells on the spreadsheet.
CAUSEThis problem occurs when all of the following conditions are true:
RESOLUTIONMicrosoft 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.aspThere are three methods for resolving this behavior.
Method 1: Changing the Order of the Lines of CodeIn the Visual Basic macro or procedure that displays the UserForm, set the focus to another control before setting the Value property of the OptionButton control to True. The following example demonstrates this method:
Method 2: Do Not Set Focus with Code Attached to an OptionButton ControlDo not assign code to an OptionButton control to set the focus to a RefEdit control before a form is displayed. Instead, leave any OptionButton controls unselected to allow the user to make the choice.
Method 3: Do Not Set the Value Property of an OptionButton Control to TrueDo not set the focus to another control in the procedure or macro that displays the UserForm if the same procedure or macro sets the Value property of the OptionButton control to True. Setting the Value property of the OptionButton control to True triggers the Click event procedure that is assigned to the OptionButton control.
STATUSMicrosoft 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 INFORMATIONIf the behavior occurs, you may be able to get out of the situation without having to close Microsoft Excel in the Close Program dialog box. However, this is only possible if the Visual Basic Editor is running. Follow these steps to avoid having to close Microsoft Excel:
REFERENCESFor 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 cursor custom dialog box vbe text box option
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |