Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Automatically close a message box

I need to have a message box (vbokonly) close automatically if it has been
open for longer than 10 seconds.

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Automatically close a message box

I think all code execution stops while a message box or input box is
displayed. You could make your own Userform to look like a Msgbox and
use the ontime method to close it after a period of time.

ed wrote:
I need to have a message box (vbokonly) close automatically if it has been
open for longer than 10 seconds.

thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Automatically close a message box

Here is some code for a timed message box...

'***requires reference to "Windows Script Host Object Model"
Public Sub MessageTest()
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long

Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=10, _
Title:="Hello, World", Type:=vbOKOnly)

End Sub
--
HTH...

Jim Thomlinson


"ed" wrote:

I need to have a message box (vbokonly) close automatically if it has been
open for longer than 10 seconds.

thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Automatically close a message box

Nice Jim!

"Jim Thomlinson" wrote in message
...
Here is some code for a timed message box...

'***requires reference to "Windows Script Host Object Model"
Public Sub MessageTest()
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long

Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=10, _
Title:="Hello, World", Type:=vbOKOnly)

End Sub

....


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When shutting down my computer, message says Excel can't close. Chicago Excel Discussion (Misc queries) 3 November 22nd 05 09:24 PM
Warning message on file close Lambtwo Excel Worksheet Functions 1 October 25th 05 03:31 AM
Force a Message Box to close unanswered jennie Excel Programming 1 October 12th 05 10:23 AM
Close a message box Nigel Excel Programming 1 September 15th 05 12:49 AM
On Close Macro - stop warning message M Shannon Excel Programming 2 October 2nd 04 04:04 PM


All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"