Microsoft KB Archive/193424

= BUG: Excel 97 Menus Fail with In-Place Activation from MDI Child =

Article ID: 193424

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Excel 97 Standard Edition

-



This article was previously published under Q193424



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.



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

 Press the F5 key to run the project. Select New from the File menu. In the Insert Object DialogBox, select Create New and "Microsoft Excel Worksheet" under Object Type. Repeat steps 3 and 4 so that you have two MDI children with embedded worksheets. Put some data in some cells on both worksheets.</li> Select a cell on the 2nd worksheet. From the Edit menu, select Clear and then All.</li> 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.</li></ol>

Method 2: Create New Standard EXE Project
<ol> Create a Standard EXE project in Visual Basic. Form1 is created default.</li> Set Form1's MDIChild property to True.</li> Place an instance of the OLE control on Form1. In the Insert Object DialogBox, select Create New and "Microsoft Excel Worksheet" under Object Type.</li> Add a new form (Form2) and repeat steps 2 and 3 for Form2.</li>  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 </li> Select Project1 Properties from the Project menu and set the Startup Object as MDIForm1.</li> Press the F5 key to run the project.</li> Double-click in Worksheet on Form2 and enter some numbers in some cells.</li> Repeat step 8 for Form1.</li> Switch back to Form2 and, from the Edit menu, select Clear and then select All.</li> Repeat step 10 for Form1. On one of the forms, the command works but on the other form, the command fails to respond.</li></ol>

<div class="references_section">