I haven't spent the time to walk through every line of code but I saw an error right away so let's start with that.
The variables ASave and BSave declared in your Module are local to the Module and are not seen by the code in the Form. The variables ASave and BSave in the form are not declared so VBA assumes they are of type Variant and local to the form. Therefore they are always False, and your Sub always exits immediately and allows Excel to continue with the save.
I strongly suggest that you go into the VBA window, click Tools, Options, Editor and click Require Variable Declarations. This will automatically insert the line
in every new module. This will cause an error if you try to use an undeclared variable. You would get an error with this code, showing that you have a problem.
To fix this, in the Module change the declarations to look like
Also
This appears correct. Setting Cancel to True will cancel the completion of the event, in this case a save. If you allow it to be False, then Excel will continue with the save after the Sub has exited.
Bookmarks