
Option Explicit
Const WaitTime As Integer = 5 '// Time to wait in secs
'// Button type constants
Const btnOK As Integer = 0 '// Display OK button only
Const btnOKCancel As Integer = 1 '// Display OK and Cancel buttons.
Const btnAbortRetryIgnore As Integer = 2 '// Display Abort, Retry, and Ignore buttons.
Const btnYesNoCancel As Integer = 3 '// Display Yes, No, and Cancel buttons.
Const btnYesNo As Integer = 4 '// Display Yes and No buttons.
Const btnReCancel As Integer = 5 '// Display Retry and Cancel buttons.
'// Icon constants
Const IconStop As Integer = 16 '// Show "Stop Mark" icon.
Const IconQ As Integer = 32 '// Show "Question Mark" icon.
Const IconExc As Integer = 48 '// Show "Exclamation Mark" icon.
Const IconInfo As Integer = 64 '// Show "Information Mark" icon.
'// Button defaults
Const btnDefault1 As Integer = 0 '// First button is default.
Const btnDefault2 As Integer = 256 '// Second button is default.
Const btnDefault3 As Integer = 512 '// Third button is default.
Const btnDefault4 As Integer = 768 '// Fourth button is default.
Const btnAppModal As Integer = 0 '// Application modal; _
'the user must respond to the message box _
'before continuing work in the current application.
Const btnSysModal As Double = 4096 '// System modal; all applications are suspended _
'until the user responds to the message box.
Const btnHelp As Double = 16384 '// Adds Help button to the message box
Const btnMsgForegrnd As Double = 65536 '// Specifies the message box window as the foreground window
Const btnTextRight As Double = 524288 '// Text is right aligned
Const btnRightLeft As Double = 1048576 '// Specifies text should appear as right-to-left _
'reading on Hebrew and Arabic systems
Sub Tester()
Dim WshShell As Object
Dim RetValue As Integer
Set WshShell = CreateObject("WScript.Shell")
RetValue = WshShell.Popup("Is this good or what ?...Please respond!...", 5, _
"Answer This Question:", btnYesNo + IconInfo)
'// Valid Return values
'1 = OK Button, 2 = Cancel Button, 3 = Abort Button, 4 = Retry Button
'5 = Ignore Button, 6 = Yes Button, 7 = No Button
Select Case RetValue
Case 6: MsgBox "Thats great..glad you answered!"
Case 7: MsgBox "Why ? what's wrong?"
Case -1: MsgBox "You didn't respond!"
End Select
End Sub
Sub StatusMsgBox()
CreateObject("WScript.Shell").Popup _
"Excel is starting to Calculate the Cells", 2, "ATTENTION"
End Sub