Interesting problem

  • Thread starter Thread starter kdev
  • Start date Start date
K

kdev

I have a bit of code that is supposed to prevent users from saving
however, it is also preventing me from saving the workbook with the bi
of code in!! Does anyone have an idea on how to get the workbook to sav
the bit of code (which goes in the workbook module). Code as follows:


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
MsgBox "Can't save"
Cancel = True
End Sub


Thanks
 
Try:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
select case application.username
case "Your Name"
else
MsgBox "Can't save"
Cancel = True
end select
End Sub
 
Back
Top