The problem is that the Before_Save event occurs before the user enters the SaveAs box appears.
Your routine will prevent the template being Saved (without password) .
If you put
at the start of the routine, the routine won't run if the user has called SaveAs.
On the other hand, the User will be able to click SaveAs and not change the name and still successfully save the template file.
I'm reminded of an old saying, "it difficult to make anything foolproof, because fools are so ingenious."
(P.S. I suspect you may have other questions. If so, I'm leaving town for the weekend, not ignoring you.)
Bookmarks