Excel Workbook Open Event macro doesn't always run

后端 未结 10 576
刺人心
刺人心 2020-12-11 04:23

I\'ve got a Workbook_Open event macro (and it\'s in ThisWorkbook) that doesn\'t always run.

  • If Excel is closed and I double-click the .xls file from Windows Ex
10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 04:44

    I was experiencing almost identical behavior, and found that it is due to a bug that occurs if conditional formatting rules are erroring out. It turns out that if the conditional formatting rules are based on any setup by the macros, and that causes the conditional formatting to error, the Workbook_Open macro will not even attempt to run.

    To test, make a copy of your file, and delete all conditional formatting from the workbook. Save and reopen. If it fixes your issue, then rework the conditional formatting rules to not depend on functions/values that will be broken before the Workbook_Open macro runs.

提交回复
热议问题