Message box

  • Thread starter Thread starter Isy Taman
  • Start date Start date
I

Isy Taman

Is there a way to have a message box appear on the screen
that will assume an "OK" response after a timed interval
in the absence of the user pressing "OK".

Thank you.
 
No.

You can simulate this by using a user form which looks like a message box
and put a timer control on it which will close the form should no input be
forthcoming.



--
Regards,


Bill Lunney
www.billlunney.com
 
Dave Peterson said:
This was posted by Jim Rech to a similar request:

If you have the Windows Scripting Host Obj model installed (WSHOM.OCX), and
I believe it's part of Windows 98 among other things, you can run this:

Sub SelfClosingMsgBox()
CreateObject("WScript.Shell").Popup "Hello", 2, _
"This closes itself in 2 seconds"
End Sub

And if you wanted to be able to check to see if they hit ok or cancel:

Sub SelfClosingMsgBox2()
Dim Resp As Long
Resp = CreateObject("WScript.Shell").Popup("Hello", 2, _
"This closes itself in 2 seconds", vbOKCancel)
'MsgBox Resp
If Resp = vbCancel Then
MsgBox "cancel was hit"
End If

End Sub

That would be really handy. When I run the macro SelfClosingMsgBox on
Windows XP with Excel 2002, I see the message box but it does not
close itself.

I have the file
C:\WINDOWS\system32\wshom.ocx
dated 01/14/2003,
which must be the Windows Scripting Host ocx.
 
Back
Top