Visual Basic Reference

Visual Studio 6.0

OLERequestPendingMsgText Property

See Also    Example    Applies To

Returns or sets the text of the alternate "busy" message displayed when mouse or keyboard input is received while an automation request is pending. Not available at design time.


object.OLERequestPendingMsgText [ = string]

The OLERequestPendingMsgText property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
string A string expression that evaluates to the message text that will be displayed in the alternate message box for the ActiveX request pending condition.


Visual Basic displays a default Component Request Pending dialog box when mouse or keyboard input is received while an automation request is pending. This dialog box includes text and a Switch To button which are intended for use with visible ActiveX components such as Microsoft Excel. There are situations in which the default dialog box may not meet your needs:

  • Your program may call a method of an object provided by an ActiveX component that has no user interface. ActiveX components created using Visual Basic Professional edition, for example, may run in the background without any visible forms.

  • The ActiveX component you call may have been created using the Remote Automation features of Visual Basic, Enterprise edition, and may be running on another computer located at some distance from the user.

  • If your program has loaded a Microsoft Excel workbook using the GetObject function, the workbook will not be visible when the user switches to Microsoft Excel. In fact, Microsoft Excel itself may not be visible, in which case the Switch To button does nothing.

In these situations, the default text and Switch To button are inappropriate and may confuse the user of your program.

The OLERequestPendingMsgText property allows you to replace the default Component Request Pending dialog box with an alternate message box. Setting OLERequestPendingMsgText to your own message string causes the default Component Request Pending dialog box to be replaced by a simple message box containing your message text and an OK button.

Note   Once an automation request has been accepted by an ActiveX component, there is no way to cancel it.

If OLERequestPendingMsgText is equal to an empty string (""), the default Component Request Pending dialog is displayed.

Important   When you know that an automation request may take more than a few seconds, and you are using a hidden or remote ActiveX component, you should set an alternate message. For remote ActiveX components, the alternate message is recommended for all requests. Network traffic may occasionally cause even a very short ActiveX request to take several seconds.