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.

XL2010/ Workbook_Open() event fails when opening a workbook in protected view and then clicking "Enable Editing"


View products that this article applies to.

Symptom

  • You have the Trust Center Macro settings in Excel 2010 set to: "Enable all macros (not recommended; potentially dangerous code can run)"
  • You open a macro enabled workbook in Excel 2010 that opens in Protected View, for example by opening the workbook from an email message.
  • The workbook has VBA code in the Workbook_Open event.
  • You click the "Enable Editing" button, you may receive a run-time error or you may get unexpected results from the macro.

↑ Back to the top


Cause

If you have your Macro Settings set to "Enable all Macros" the Workbook_Open() event is triggered before Excel has exited from the Protected View workbook and opened the workbook enabled for editing.

↑ Back to the top


Resolution

Change your Macro Settings in the Trust Center to "Disable all macros with notification". This allows Excel to open the workbook enabled for editing before the user chooses to allow macros to run through the Trust Bar.

↑ Back to the top


More information

Microsoft is aware of this problem.

Microsoft does not recommend disabling "Protected View".

↑ Back to the top


Keywords: KB2389459

↑ Back to the top

Article Info
Article ID : 2389459
Revision : 2
Created on : 8/27/2010
Published on : 8/27/2010
Exists online : False
Views : 362