CLOSE MESSAGE BOX PROGRAMMATICALLY

  • Thread starter Thread starter donstock
  • Start date Start date
D

donstock

Can a message box be closed programmatically? without any interaction with
the keyboard or mouse? I'm trying to display a message box for a given
amount of time then have it automatically close.
 
Found this in google, hope it helps

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 ru
this:

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

By, Jim Rech


Rocke
 
Jim Rech posted this solution:

Sub SelfClosingMsgBox()
CreateObject("WScript.Shell").Popup "Hello", 2, _
"This closes itself in 2 seconds"
End Sub
 
Thanks, that works very well. I've also created a userform to look like a
message box, and use the OnTime method to unload the form after a given
interval.

D.S.
 
Ivan,
the link seems to be missing to download the workbook with the scripting
example. Just a heads up.
 
Oh Jezz !! sorry ...... thanks Tom :-)
Appreciate the heads up.

Linked up now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top