Using the Quit Event : Application Events « Application « VBA / Excel / Access / Word






Using the Quit Event

 
Sub Application_Quit()
    Dim strMessage As String
    Select Case Format(Date, "MM/DD/YYYY")
        Case "01/13/2006"
            strMessage = "Next Monday is Martin Luther King Day."
        Case "02/17/2006"
            strMessage = "Next Monday is Presidents Day."
        Case "05/26/2006"
            strMessage = "Next Monday is Memorial Day."
        Case "06/30/2006"
            strMessage = "Next Tuesday is Independence Day." & _
                " Monday is a company holiday."
        Case "09/01/2006"
            strMessage = "Next Monday is Labor Day."
        'other National Holidays here
        End Select
        MsgBox strMessage, vbOKCancel + vbExclamation, "Don't Forget..."

End Sub

 








Related examples in the same category

1.Using the Startup Event
2.Using the ItemSend Event
3.Using the AdvancedSearchComplete Event and the AdvancedSearchStopped Event