คือจะให้โปรแกรมทำงานโดยเมื่อกดlogin แล้วถ้าชื่อผู้ใช้และรหัสผ่าน ถูกต้องถึงจะเข้าสู่โปรแกรมได้อะค่ะ แต่พอกดแล้วมันบอกว่า error ค่ะ
Private Sub LoginButton_Click()
Dim UserName, Password As String
UserName = TextBox1.Text
Password = TextBox2.Text
If UserName = "admin" And Password = "1234" Then
MsgBox = "Welcome"
Unload Me
Else
MsgBox = "User or Password error"
Actionworkbook.Close
End If
End Sub
ทำระบบLogin ใน excel แต่รันแล้ว error ขอผู้รู้ช่วยดูหน่อยค่ะ
Private Sub LoginButton_Click()
Dim UserName, Password As String
UserName = TextBox1.Text
Password = TextBox2.Text
If UserName = "admin" And Password = "1234" Then
MsgBox = "Welcome"
Unload Me
Else
MsgBox = "User or Password error"
Actionworkbook.Close
End If
End Sub