Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imamuddinwp/522f74b9760efb4da9f994080dacc6a7 to your computer and use it in GitHub Desktop.
Save imamuddinwp/522f74b9760efb4da9f994080dacc6a7 to your computer and use it in GitHub Desktop.
Excel VBA : Lock a macro with expire date; Excel VBA expire validation for macro; Macro will not execute after expiration date. User will notify with popup message; Excel Application also will close. powered by Imam Uddin; imamcu07
Sub My_Operation_Name()
'Expired Date Validations
Dim onLineHelp As Object
Dim cLoseBook As Integer
Dim exdate As Date
exdate = "27/03/2020"
Set onLineHelp = CreateObject("Wscript.Shell")
If Date > exdate Then
cLoseBook = MsgBox("Internal Error Occured!!!" & vbCrLf & " " & vbCrLf & "Data or file missing in Execution Time; DO YOU NEED ONLINE HELP ???" & vbCrLf & " " & vbCrLf & "powered by ImAmUdDiN => fb.com/imamcu07", vbYesNo, "Message From Md.ImAmUdDiN")
If cLoseBook = vbYes Then
onLineHelp.Run ("https://about.me/imamcu07")
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.Quit
Else
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.Quit
End If
Exit Sub
End If
'-------All Code paste after this line
'----End Of All Operations
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment