First of all, I apologise for the lack of, or incorrect, terminology for this query.
Is there any way to bypass code that exists under Workbook 'BeforeClose' event, when required?
Here's what's happening...
I have an "On Error Goto GenErr" in various locations in the project incase there is a problem, which causes a MsgBox to appear and then the workbook closes automatically without saving changes. However, additional code runs via the 'BeforeClose' which I don't want to run unless the user closes the workbook (or Excel) manually.
I have code under BeforeClose that just brings up a different MsgBox (it's like a reminder message requiring user to click yes or no) and if yes is selected, then the workbook continues to close, otherwise remains open.
Any suggestions? Thanks.
Is there any way to bypass code that exists under Workbook 'BeforeClose' event, when required?
Here's what's happening...
I have an "On Error Goto GenErr" in various locations in the project incase there is a problem, which causes a MsgBox to appear and then the workbook closes automatically without saving changes. However, additional code runs via the 'BeforeClose' which I don't want to run unless the user closes the workbook (or Excel) manually.
I have code under BeforeClose that just brings up a different MsgBox (it's like a reminder message requiring user to click yes or no) and if yes is selected, then the workbook continues to close, otherwise remains open.
Any suggestions? Thanks.