DOCUMENT:Q193424 29-SEP-1998 [vbwin] TITLE :BUG: Excel 97 Menus Fail with In-Place Activation from MDI Child PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0,6.0,97 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0 - Microsoft Excel 97 for Windows --------------------------------------------------------------------- SYMPTOMS ======== When Excel worksheets are used as embedded objects on MDI Child forms in Visual Basic, the Excel menus that appear for in-place activation will either not respond or will generate an Invalid Page Fault when selected. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- There are two ways to reproduce the problem. The first method is to use the Olecont.vbp sample shipped with Visual Basic 5.0. If you only have Visual Basic 6.0 installed, use the second method. Method 1: Use the Olecont.vbp Sample ------------------------------------ 1. Start Visual Basic and open the sample project Olecont.vbp. By default this project is located in the following folder: Program Files\DevStudio\VB\Samples\PGuide\olecont 2. Press the F5 key to run the project. 3. Select New from the File menu. 4. In the Insert Object DialogBox, select Create New and "Microsoft Excel Worksheet" under Object Type. 5. Repeat steps 3 and 4 so that you have two MDI children with embedded worksheets. 6. Put some data in some cells on both worksheets. 7. Select a cell on the 2nd worksheet. From the Edit menu, select Clear and then All. 8. Repeat step 7 with the first worksheet. The menu commands do not react and cells are not cleared. If you choose some other menu items, they are either ignored or cause an IPF and shut down the program. Method 2: Create New Standard EXE Project ----------------------------------------- 1. Create a Standard EXE project in Visual Basic. Form1 is created default. 2. Set Form1's MDIChild property to True. 3. Place an instance of the OLE control on Form1. In the Insert Object DialogBox, select Create New and "Microsoft Excel Worksheet" under Object Type. 4. Add a new form (Form2) and repeat steps 2 and 3 for Form2. 5. Add an MDIForm (MDIForm1) to the project and paste the following code in to MDIForm1: Private Sub MDIForm_Load() form1.show form2.show End Sub 6. Select Project1 Properties from the Project menu and set the Startup Object as MDIForm1. 7. Press the F5 key to run the project. 8. Double-click in Worksheet on Form2 and enter some numbers in some cells. 9. Repeat step 8 for Form1. 10. Switch back to Form2 and, from the Edit menu, select Clear and then select All. 11. Repeat step 10 for Form1. On one of the forms, the command works but on the other form, the command fails to respond. REFERENCES ========== For additional information, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q191615 TITLE : BUG: Menu Disabled in Application Activated Using OLE Control Additional query words: kbdss kbDSupport kbVBp kbVBp500bug kbVBp600bug kbActiveX kbExcel kbOLE ====================================================================== Version : WINDOWS:5.0,6.0,97 Platform : WINDOWS Issue type : kbbug ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.