Thread
:
Sub Not Working
View Single Post
#
4
Posted to microsoft.public.excel.programming
Rob
external usenet poster
Posts: 718
Sub Not Working
HA! I feel sooo silly.
Thanks.
What if i wanted to add another username to ba allowed to save (i.e. pbcj)?
I tried below but I get a type mismatch runtime error 13.
If Application.UserName < "rcj" Or "pbcj" Then
Rob
"Don Guillett" wrote:
try < "rcj"
--
Don Guillett
SalesAid Software
"Rob" wrote in message
...
Here's the code I'm working with...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Application.UserName < rcj Then
Cancel = True
MsgBox "Sorry, But You Don't Have Permission To Save This File",
vbExclamation, "Invalid Permission"
End If
MsgBox Application.UserName
End Sub
I get the error and it doesn't save, but if I use ... Application.UserName
=
rcj Then I get to save but that's backwards I want it to elvaluate what
the
username is and if it's not my username than it cancels the save and lets
the
user know. Why is it working backwards?
Thanks,
Rob
Reply With Quote
Rob
View Public Profile
Find all posts by Rob