The public declarations don't really belong in the ThisWorkbook module - they should be in a regular module. If you have them in ThisWorkbook, you need to access them as members of that object from other modules - i.e. use ThisWorkbook.variable_name and not just variable_name.
You could turn your routine into a function that returns True if everything is ok and False otherwise. Then the deactivate event can check the return value and simply reactivate the sheet if need be.
|