VBA代码:
Private Sub Workbook_Open()
MsgBox "YANG6815475欢迎你的到来", vbQuestion, "联系电话:0123456789"
If Application.InputBox("请输入操作权限密码:", "系统登陆") = 55555555 Then
Else
MsgBox "密码错误,请重输", vbCritical + vbOKOnly, "你还有两次机会"
If Application.InputBox("请输入操作权限密码:", "系统登陆") = 8197709 Then
Else
MsgBox "密码错误,再给你一次机会!", vbCritical + vbOKOnly, "你还有一次机会"
If Application.InputBox("请输入操作权限密码:") = 55555555 Then
Else
MsgBox "你无权进入本系统!请向YANG6815475申请密码!", vbCritical + vbOKOnly, "你没有机会啦!"
Application.Quit
End If
End If
End If
End Sub