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.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


Keywords: KB826826, kbbug

↑ Back to the top

Article Info
Article ID : 826826
Revision : 7
Created on : 1/5/2007
Published on : 1/5/2007
Exists online : False
Views : 382