When a Microsoft Office Excel worksheet is embedded in an object linking
and embedding (OLE) container and is in-place active, and a macro shows a
Visual Basic for Applications (VBA) dialog box that uses the RefEdit control, the RefEdit control may not work, and you may be unable to switch back to the
sheet to select cells.
The problem occurs when Excel is embedded in
some applications (such as Microsoft Office Word), but may not occur in other
applications.
↑ Back to the top
When Excel is in-place active in an external application
and a VBA dialog box is displayed, Excel takes focus away from that application
and causes a WM_ACTIVATEAPP message to be sent to the main window of the host
application. The host notifies any active object of this event. In the case of
Excel, this temporarily disables the object window, making it unavailable to
the RefEdit control on the VBA dialog box. The control cannot switch back to
the sheet to allow the user to select cells.
↑ Back to the top
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section. There are currently no workarounds for this issue.
↑ Back to the top
When Excel is not embedded and a VBA dialog box is
displayed, Excel does not change thread focus and the problem does not occur.
Also, if an OLE container does not call IOleInPlaceActiveObject::OnFrameWindowActivate when it receives a WM_ACTIVATEAPP message, the problem does not
occur. This is not a valid workaround, however, because this notification is
required, and failure to notify the object server of frame state changes can
lead to other improper OLE behavior.
↑ Back to the top
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
281542
RefEdit control does not work on form in a Com Add-In in Excel
↑ Back to the top