sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
good morning,
I have some code that I've written/compiled for making a "registration key" of sorts for a workbook. Only issue, if the "password, as defined in cell B39, is a series of numbers, the coding works perfectly. if the password is a word or letters, it doesn't. I'm guessing I've got everything dimmed wrong.
Someone help please. thanks!
I have some code that I've written/compiled for making a "registration key" of sorts for a workbook. Only issue, if the "password, as defined in cell B39, is a series of numbers, the coding works perfectly. if the password is a word or letters, it doesn't. I'm guessing I've got everything dimmed wrong.
Someone help please. thanks!
Code:
Dim s As StringDim namer As String
Dim d As String
Dim ExpirationDate As Date
Dim pass1 As String
Dim pass2 As String
With Sheets("Developer")
s = .Range("B34") 'username
'pass1 = .Range("B15:E15").Value 'sheet unprotect
'pass2 = .Range("B39").Value 'date password
ExpirationDate = .Range("E37") 'expiration date
d = .Range("B39").Value 'registration key
initialdate = .Range("C36") 'initializing date
End With
TryAgain:
d = Application.InputBox("Your workbook date has expired. Please enter the registration key to renew your license.", namer)
If d = False Then Exit Sub
If d = CStr(Worksheets("Developer").Range("B39").Value) Then
Sheets("Developer").Range("C36") = Date
MsgBox "Welcome Back " & s, vbOKOnly, namer
Else
MsgBox "Password Incorrect, Please try again.", vbCritical, namer
GoTo TryAgain
End If
End If