I have a button in my workbook. It looks at the Application.Username and if it equals a certain value, it puts some print in a cell, if not, an error pops up. This works fine on the original workbook I'm using, but once I save this as something else, it then stops at the username and executes the error. Why? I'm guessing it has something to do with the Username.
Code:
Private Sub CommandButton3_Click()
Range("B50").Select
ActiveSheet.Unprotect
If Application.UserName = "josh" Then
ActiveCell.Value = "Bill Kilmer"
ActiveSheet.Protect
ElseIf Application.UserName <> "josh" Then
Answer = MsgBox("You are not Bill!", vbOKOnly)
End If
ActiveSheet.Protect
If Sheets("Chris Burkert").Range("B50") = "Bill Kilmer" Then
Application.Run "'SendEmailJosh'"
End If
End Sub