Greetings, I have been using the following code to prevent users from changing the name of a workbook whenever they wanted to. Whenever I wanted to change it (because of a rev. 12 or 13a or something like that) I would just do it by changing the file name on my desktop. Not perfect or really secure I know, but it was easy and simple. There a few drawbacks of course with macro names having to be updated with each revision, or smart alecs changing it my way just to be funny. Is there some code (like a password prompt perhaps) that would allow me to change the name properly from within the app and perhaps even keep people from changing the name from the desktop? Thanks, RB
HTML:
Private Sub WorkBook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim lReply As Long
If SaveAsUI = True Then
lReply = MsgBox("Sorry, you are not allowed to save this workbook as a different name. Do you wish to save it as it's orignal name?", vbQuestion + vbOKCancel)
Cancel = (lReply = vbCancel)
If Cancel = False Then Me.Save
Cancel = True
End If
End Sub