BUG: The Code Is Not Disabled If You Press and Then Hold Down the SHIFT Key While You Open a Microsoft Excel Workbook from the Getting Started Task Pane (826826)



The information in this article applies to:

  • Microsoft Office Excel 2003
  • Microsoft Visual Studio Tools for the Microsoft Office System version 2003

SYMPTOMS

If you press and then hold down the SHIFT key while you use the Getting Started task pane to open a Microsoft Excel workbook, the code is not disabled. When you use the task pane to open a workbook that contains Microsoft Visual Basic for Applications macros or that references a managed code extension, the code always runs.

RESOLUTION

To prevent the code from running when you open a workbook, press and then hold down the SHIFT key while you use the File menu instead of the task pane to open the workbook.

STATUS

Microsoft has confirmed that this is a bug in Microsoft Office Excel 2003.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create a new Microsoft Excel file that contains managed code extensions. To do this, follow these steps:
    1. Start Microsoft Visual Studio .NET 2003.
    2. On the File menu, click New, and then click Project.
    3. Under Microsoft Office System Projects, click Visual Basic Projects, and then click Excel Workbook.
    4. Click OK to start the Microsoft Office Project Wizard.
    5. Click Create new document, and then click Finish.
    6. In the Code window, replace the following code:
      ' Called when the workbook is opened. 
      Private Sub ThisWorkbook_Open() Handles ThisWorkbook.Open 
      
      End Sub
      with:
      ' Called when the workbook is opened. 
      Private Sub ThisWorkbook_Open() Handles ThisWorkbook.Open 
          MessageBox.Show("The Open Event Fired.")
      End Sub 
    7. Press the F5 key to build the project and then run the project.

      The workbook opens in Excel, and a message box appears. Click OK to dismiss the message box.
  2. Close the workbook. Do not close Excel.
  3. On the View menu in Excel, click Task Pane to display the Getting Started task pane.
  4. Press and then hold down the SHIFT key while you click the workbook in the Getting Started task pane.

    When the workbook opens, the Open event from the managed code extension runs.
  5. Click OK to dismiss the message box. Close the workbook.
  6. Press and then hold down the SHIFT key while you use the File menu in Excel to open the workbook.

    The Open event from the managed code extension does not run.

Modification Type:MinorLast Reviewed:2/3/2006
Keywords:kbBug KB826826 kbAudDeveloper