How can it be possible kill the file if it is expired?
I have the macro code which kills the excel file if it is expired.
In my code the expired date is 2/20/2015 and the password is 1234
If I don’t enter 1234 it kills (delete without removing it to garbage)
Can I do same thing when your expired date is over then kill the file? Thanks…
My code =>
Public MyDate As Variant
Public Passwd As String
Private Sub WorkBook_Open()
Call ToggleCutCopyAndPaste(False)
MyDate = #2/20/2015# ’ Assign a date.
Passwd = “1234” 'Assign password
If Date > MyDate Then
Application.ScreenUpdating = False
Sheets(“Intro”).Visible = True
Sheets(“Data”).Visible = xlVeryHidden
Application.ScreenUpdating = True
MsgBox “Oops! Test/Evaluation period of the utility has been expired.” & vbCrLf & _
“Please ask the concern person to get the updated utility.”, vbCritical, "Outdated/Expired Version"
mbox = Application.InputBox(“Please input the licence 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(“Data”).Visible = True
Sheets(“Intro”).Visible = False
End If
End If
End Sub