Is there a way to prevent a user from changing the name of a workbook by using ?saving as??
Would the code be inserted into the workbook/beforesave section?
Thanks once again???..
Is there a way to prevent a user from changing the name of a workbook by using ?saving as??
Would the code be inserted into the workbook/beforesave section?
Thanks once again???..
Hi ,
The following code should work:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then Cancel = True
End Sub
Maybe a slight change to force it as a normal save
[vba]
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim sFile
If SaveAsUI Then
Application.EnableEvents = False
Cancel = True
ThisWorkbook.Save
End If
Application.EnableEvents = True
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
If the user's security is set to high, none of this matters anyways and they can save it however they like, correct?
True, macros will be automatically disabled. Does anyone actually use that? I know some It departments impose a no-macro rule, but I bet not many people set it high themselves.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Thanks a lot again! It works perfect??
As for the Macro security setting, the user needs to have the macros enabled for the app to work for them anyway and I am only worried about the majority of the users not the ones that like to tear things apart to see how they work.
Those ones are pretty hard to control without a small (or large) electrical pulse that emanates from their keyboard when entering somewhere they shouldn?t be.
Is that option under the application or workbook section? LOL
Thanks again for all your help?..
Yeah - I know both my former and current employers default excel to high security.