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.

The main window appears in Excel 2007 when you load an Excel OLE object


View products that this article applies to.

Symptoms

When you load an Excel OLE object (such as an embedded worksheet or chart) in Excel 2007 you may notice that the main Excel window will display on the taskbar or come to the foreground during the load.  Depending on your security settings, the window may temporarily appear while a security dialog box appears, or it seems to be empty and will remain open even after the OLE client has completed using Excel. 

This behavior is new to 2007 Microsoft Office system  starting with Service Pack 2 (SP2). It only applies to OLE objects that contain VBA macros or ActiveX controls.

↑ Back to the top


Cause

Security changes that were made for SP2 can cause the behavior described in Symptoms for some OLE clients.  Starting with SP2, macro security decisions for OLE objects are now synchronous decisions made during loading instead of during activation.  The purpose in making the main Excel window visible is to let the user be able to switch to Excel where a security warning or modal prompt can occur during the loading of the object, before the object can be in place started.  Excel cannot control the correct z-ordering of modal dialogs for objects that have not yet been started. Therefore, it will display such dialogs from its main window, which will be visible to allow for interaction. 

There are known conditions which may cause the main window to display over another window or flash on the taskbar when no dialog box is being displayed.  These are side effects of the design change and will be addressed in future product versions.  However, the display of the main Excel window during an OLE load if the object contains macros or ActiveX controls is now expected behavior for security reasons. 

↑ Back to the top


Resolution

Method 1:  Manually close the Excel window or switch to the OLE host app window from the taskbar.  

 Note: Do not move window focus to another application.

Method 2:  This issue should only affect users with OLE objects that contain macros. Therefore, consider removing your macros from the object and putting them in a dependent book or add-in where they can be loaded separately from the OLE object.

Method 3:  For OLE hosts doing implementation, you can change your load method to using moniker binding instead of OLE load by storage, where the code path is different, and we avoid the 719588-fix code.   This is good for companies that don�t want to load macros in the OLE objects.  

↑ Back to the top


Keywords: KB2009802, kbnomt, kbrapidpub

↑ Back to the top

Article Info
Article ID : 2009802
Revision : 1
Created on : 12/10/2009
Published on : 12/10/2009
Exists online : False
Views : 221