How to stop Excel from firing Worksheet_Change before Workbook_BeforeSave?

前端 未结 2 1365
情书的邮戳
情书的邮戳 2020-12-07 01:01

Update: Issue Resolved A colleague of mine was changing a cell during Workbook_BeforeSave() without disabling events, therefore triggerin

2条回答
  •  被撕碎了的回忆
    2020-12-07 01:27

    Add a global flag variable.

    Input a function that fires when key pressed and if CTRL + S it sets flag to true.

    The worksheet_change event should short circuit if this flag is true.

    And workbook_aftersave should change it back to false.

提交回复
热议问题