Microsoft KB Archive/826826

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

Article ID: 826826

Article Last Modified on 1/5/2007

-

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.



Steps to Reproduce the Behavior
 Create a new Microsoft Excel file that contains managed code extensions. To do this, follow these steps:  Start Microsoft Visual Studio .NET 2003. On the File menu, click New, and then click Project. Under Microsoft Office System Projects, click Visual Basic Projects, and then click Excel Workbook. Click OK to start the Microsoft Office Project Wizard. Click Create new document, and then click Finish.</li>  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(&quot;The Open Event Fired.&quot;) End Sub </li> 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.</li></ol> </li> Close the workbook. Do not close Excel.</li> On the View menu in Excel, click Task Pane to display the Getting Started task pane.</li> 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.</li> Click OK to dismiss the message box. Close the workbook.</li> 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.</li></ol>

Keywords: kbbug KB826826

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.