Created
May 14, 2020 03:00
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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