How to stop Excel from firing Worksheet_Change before Workbook_BeforeSave?
Posted
by
Camil Bancioiu
on Stack Overflow
See other posts from Stack Overflow
or by Camil Bancioiu
Published on 2012-01-11T12:38:14Z
Indexed on
2012/04/05
5:30 UTC
Read the original article
Hit count: 178
Update: Issue Resolved A colleague of mine was changing a cell during Workbook_BeforeSave()
without disabling events, therefore triggering Worksheet_Change()
. Yes, silly, but at least it's our fault, not Excel's
I've noticed that whenever I hit Ctrl+S in Excel, the Worksheet_Change()
is fired before Workbook_BeforeSave()
. Is it possible to supress this behaviour using VBA code, but without supressing all events (i.e. without Application.EnableEvents = false
)?
This happens regardless of what I'm doing. I've read about someone having a similar issue with ComboBoxes, but I'm not editing ComboBoxes, yet Worksheet_Change()
fires always before saving.
Any ideas? I'm only trying to figure out how to bypass some code inside Worksheet_Change()
when the document is saved, because that code is only supposed to be executed when the user actually changes something, not when the workbook is saved. Saving is by no means changing...
© Stack Overflow or respective owner