BUG: Excel 97 Menus Fail with In-Place Activation from MDI Child (193424)



The information in this article applies to:

  • Microsoft Visual Basic Learning Edition for Windows 5.0
  • Microsoft Visual Basic Learning Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 5.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 5.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Excel 97 for Windows

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.

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:

191615 BUG: Menu Disabled in Application Activated Using OLE Control


Modification Type:MajorLast Reviewed:5/13/2003
Keywords:kbbug KB193424