Interesting problem

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top