The xlam Excel addin I'm building is interacting with externally sourced spreadsheet. The trouble is that the sheet, among other things in Workbook Change event has code that throws a MsgBox popup, messing with automation as it waits for user input. The popup is not called directly - the Workbook Change event is calling a custom Sub called "ShowPopup". Then inside the "ShowPopup" we have MsgBox call.
My thought was that if I could override the ShowPopup sub, I could prevent it from creating the MsgBox. Is it possible to do?
Constraints to the potential solutions:
- Fully overriding the Workbook Change event is a no-go, there is stuff there that's actually needed.
- I can't make any modifications to the code of the externally sourced sheet that the xlam Excel addin is interacting with
- Application.DisplayAlerts = False doesn't work for explicitly called MsgBox'es
Fakes
API could be abused to do this... but invoking a Rubberduck test method in regular VBA code will not hook up the fake - the test engine does. We use EasyHook to hook into the VBA libraries and -yes, overrideMsgBox
calls. So... it's technically possible, yes. – Mathieu Guindon