Hi! Everyone
I have this customized welcome message in Excel 2010 and I would like to add Ok and Cancel button with a message "Do you wish to Continue" below my customized message.
If Ok, then enter the workbook and if cancel then close the workbook.
Code:
Private Sub Workbook_Open()
Dim sName As String
Dim sTxt As String
Dim CurrTime As Long
Dim NameOfWorkbook
NameOfWorkbook = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))
sName = Environ("UserName")
CurrTime = Hour(Now)
Select Case CurrTime
Case Is > 18
sTxt3 = "Disclaimer: This document is a property of Selected Personnel. This contains confidential information and is intented only for the authorised personnel. If you are not the intended personnel you are notified that disclosing, disseminating, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited."
sTxt = "Good Evening ! "
sTxt1 = "Welcome "
sTxt2 = "To - "
End Select
MsgBox Format(Now(), "dd/mmmm/yyyy HH:mm:ss AM/PM") & vbCrLf & vbCrLf & sTxt & vbCrLf & vbCrLf & sTxt1 & sName & vbCrLf & vbCrLf & sTxt2 & NameOfWorkbook & Chr(10) & vbCrLf & vbCrLf & sTxt3
End Sub
Any help would be grateful.