Microsoft KB Archive/313102

= BUG: RefEdit control does not work when Excel is embedded in some containers =

Article ID: 313102

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q313102



SYMPTOMS
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.



CAUSE
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.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section. There are currently no workarounds for this issue.



MORE INFORMATION
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.

