Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Displayed UserForm Allows Interactivity When ShowModal Property Is Set to True


View products that this article applies to.

This article was previously published under Q215861

↑ Back to the top


Symptoms

When you display a UserForm in Microsoft Excel, you can still interact with the workbook even though you have turned off interactivity by setting the ShowModal property to True.

↑ Back to the top


Cause

This problem occurs when you have a Microsoft Visual Basic for Applications macro which contains code similar to the following behind the user form:
Application.Interactive = False
Application.Interactive = True
				
When you set Application.Interactive to False and then True, it overcomes the ShowModal property setting of True.

↑ Back to the top


Workaround

To work around this problem, do not use the Application.Interactive property to control interactivity with the user form. Instead, use only the ShowModal property. To use the ShowModal property, follow these steps:
  1. In Microsoft Excel, press ALT+F11 to activate the Visual Basic Editor.
  2. If the Properties window is not displayed, press F4 or click Properties Window on the View menu.
  3. In the Properties window, click the box to the right of the ShowModal property.

    NOTE: You can find the ShowModal property alphabetically on the Alphabetic tab, or under the Behavior category on the Categorized tab.
  4. Click the drop-down arrow for the ShowModal property, and then click the appropriate setting.

    When the ShowModal property is True, interactivity is disabled. When the ShowModal property is False, interactivity is enabled.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


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. In earlier versions of Microsoft Excel, user forms were always modal, meaning interactivity with the workbook was never allowed when the user form was displayed. In Excel 2000, you can specify interactivity with the workbook through the ShowModal property and through code.

When creating a user form, ShowModal is set to True by default, which does not allow interactivity. When the ShowModal property and the interactivity code conflict, the ShowModal property usually takes precedence. You can override this precedence in a Visual Basic for Applications macro by first setting the interactivity equal to the ShowModal setting and then setting interactivity to the setting you want. The following macro code disables interactivity
Application.Interactivity = False
				
and the following macro code enables interactivity:
Application.Interactivity = True
				
When the ShowModal property is True, interactivity is disabled. When the ShowModal property is False, interactivity is enabled.

↑ Back to the top


References

For additional information about user forms and interactivity, please see the following article in the Microsoft Knowledge Base:
234258� Displayed UserForm Does Not Allow Interactivity with Workbook

↑ Back to the top


Keywords: KB215861, kbnofix, kbbug

↑ Back to the top

Article Info
Article ID : 215861
Revision : 6
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 283