akinkaraman
Member
Is there a way to licence an excel file and give a code to users which will expire sometimes later and will ask to renew the licence?
Private Sub WorkBook_Open()
Dim edate As Date, mbox As Variant, myuser As String, wbuser As String
Application.ScreenUpdating = False
edate = DateSerial(2015, 2, 25)
If Date > edate Then
MsgBox "Oops! Test/Evaluation period of the utility has been expired." & vbCrLf & _
"Pls ask the concern person to get the updated utility.", vbCritical, "Outdated/Expired Version"
mbox = Application.InputBox("Pls input the password/code to continue...", "Password")
If mbox <> "ABCD" Then ThisWorkbook.Close False
End If
End Sub
Private Sub WorkBook_Open()
Dim edate As Date, mbox As Variant, myuser As String, wbuser As String
Application.ScreenUpdating = False
'CHANGE THE DATE
edate = DateSerial(2015, 2, 21)
If Date > edate Then
MsgBox "Oops! Test/Evaluation period of the utility has been expired." & vbCrLf & _
"Pls ask the concern person to get the updated utility.", vbCritical, "Outdated/Expired Version"
mbox = Application.InputBox("Pls input the password/code to continue...", "Password")
If mbox <> "ABCD" Then ThisWorkbook.Close False
End If
End Sub
Private Sub WorkBook_Open()
If Date >= CDate("21.02.2015") Then
Application.Quit
With ThisWorkbook
.Save
.ChangeFileAccess Mode:=xlReadOnly
Kill .FullName
.Close SaveChanges:=False
End With
End If
End Sub
Private Sub WorkBook_Open()
If Date > CDate("21.02.2015") Then
MsgBox "Oops! Test/Evaluation period of the utility has been expired." & vbCrLf & _
"Pls ask the concern person to get the updated utility.", vbCritical, "Outdated/Expired Version"
mbox = Application.InputBox("Pls input the password/code to continue...", "Password")
End If
If mbox <> "ABCD" Then
Application.Quit
With ThisWorkbook
.Save
.ChangeFileAccess Mode:=xlReadOnly
Kill .FullName
.Close SaveChanges:=False
End With
End If
End Sub
Public MyDate As Variant
Private Sub WorkBook_Open()
MyDate = #2/22/2015# ' Assign a date.
Application.ScreenUpdating = False
Sheets("Intro").Visible = True
Sheets("Clock").Visible = xlVeryHidden
Application.ScreenUpdating = True
If Date > MyDate Then
MsgBox "Oops! Test/Evaluation period of the utility has been expired." & vbCrLf & _
"Pls ask the concern person to get the updated utility.", vbCritical, "Outdated/Expired Version"
mbox = Application.InputBox("Pls input the password/code to continue...", "Password")
If mbox <> "ABCD" Then
MsgBox "Incorrect Password" & vbCrLf & _
"Pls ask the concern person to get the correct password.", vbCritical, "Wrong password"
Application.Quit
With ThisWorkbook
.Save
.ChangeFileAccess Mode:=xlReadOnly
Kill .FullName
.Close SaveChanges:=False
End With
Else
Sheets("Clock").Visible = True
Sheets("Intro").Visible = False
End If
End If
End Sub
Public MyDate As Variant
Public Passwd As String
Private Sub WorkBook_Open()
MyDate = #2/22/2015# ' Assign a date.
Passwd = "ABCD" 'Assign password
Application.ScreenUpdating = False
Sheets("Intro").Visible = True
Sheets("Clock").Visible = xlVeryHidden
Application.ScreenUpdating = True
If Date > MyDate Then
MsgBox "Oops! Test/Evaluation period of the utility has been expired." & vbCrLf & _
"Pls ask the concern person to get the updated utility.", vbCritical, "Outdated/Expired Version"
mbox = Application.InputBox("Pls input the password/code to continue...", "Password")
If mbox <> Passwd Then
MsgBox "Incorrect Password" & vbCrLf & _
"Pls ask the concern person to get the correct password.", vbCritical, "Wrong password"
Application.Quit
With ThisWorkbook
.Save
.ChangeFileAccess Mode:=xlReadOnly
Kill .FullName
.Close SaveChanges:=False
End With
Else
Sheets("Clock").Visible = True
Sheets("Intro").Visible = False
End If
End If
End Sub
Application.ScreenUpdating = False
Sheets("Intro").Visible = True
Sheets("Clock").Visible = xlVeryHidden
Application.ScreenUpdating = True