excel登录机制的vb宏,报错了
错误的参数号或无效的属性赋值Private Sub CommandButton1_Click()
Dim MyLoginStatus As Single
MyLoginStatus = 0
For i = 2 To ThisWorkbook.Sheets("UserLoginInfor").UsedRange.Rows.Count
If (Trim(ThisWorkbook, Sheets("UserLoginInfor").Cells(i, 1).Value)) = Trim(TextBox1.Value) And (Trim(ThisWorkbook.Sheets("UserLoginInfor").Cells(i, 2).Value)) = Trim(TextBos2.Value) Then
MyLoginSatus = MyLoginStatus + 1
If (Trim(ThisWorkbook.Sheets("UserLoginInfor").Cells(i, 3).Value) = "最高权限") Then
ThisWorkbook.Sheets("UserLoginInfor").Visible = True
Else
ThisWorkbook.Sheets("UserLoginInfor").Visible = False
End If
End If
Next i
If (MyLoginStatus >= 1) Then
MsgBox "登陆成功", vbInformation, "系统消息"
UserForm1.Hide
Else
MsgBox "错误的用户名和密码", vbCritical, "系统消息"
End If
End Sub
这是登录按钮的代码,过不去啊,大神看看哪的问题,我都是按百度抄的