Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message Box Duration

When a macro is run and a message box appears (using the 'MsgBox'
command) in visual basic, is there any way to have the message box
appear for say 5 seconds and then disspear from the screen, without the
user having to click OK.

Tony


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message Box Duration

I use a textbox for things like this. Put on scree, use Wait, the
remove

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Message Box Duration


-----Original Message-----
When a macro is run and a message box appears
(using the 'MsgBox' command) in visual basic,
is there any way to have the message box
appear for say 5 seconds and then disspear
from the screen, without the
user having to click OK.


That would require suspension of activity.

What you could do instead is to
create a new empty sheet
and write a message into a Cell.

Then either Wait, or continue processing.
Then, after the Wait time, or after the
processing is complete, delete that worksheet.



RClay AT haswell DOT com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message Box Duration

Newbie wrote:
*Have you tried the OnTime method?

"TONYC " wrote:

When a macro is run and a message box appears (using the 'MsgBox'
command) in visual basic, is there any way to have the messag

box
appear for say 5 seconds and then disspear from the screen, withou

the
user having to click OK.

Tony


---
Message posted from http://www.ExcelForum.com/

*

No I have not tried the OnTime method, can you please elaborate

Ton

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Message Box Duration

Hi,

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub TEST()

With CreateObject("WScript.Shell")
' Message ,Time, Title ,Type
.Popup "Welcome...", 5, "Excel User Group Korea", 0
End With

End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


--
Regards,
Soo Cheon Jheong
_ _
^ąŻ^
--




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Message Box Duration

OnTime will not work, because the event won't fire until the
message box is dismissed. Instead, set a reference to the Windows
Script Host Object Library (VBA Tools menu, References), and use
code like the following:

Dim WSH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set WSH = New IWshRuntimeLibrary.WshShell
Res = WSH.Popup(Text:="Click Yes Or No", _
secondstowait:=5, Type:=vbYesNo)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Newbie" wrote in message
...
Have you tried the OnTime method?

"TONYC " wrote:

When a macro is run and a message box appears (using the

'MsgBox'
command) in visual basic, is there any way to have the

message box
appear for say 5 seconds and then disspear from the screen,

without the
user having to click OK.

Tony


---
Message posted from http://www.ExcelForum.com/




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Message Box Duration

Hi,
This code should do what you need, l did not write it, and cannot
remember where l got it, apologies to author:

Sub msgboxfor5secs()
With CreateObject("Wscript.Shell")
.Popup "This message will be displayed for 5 seconds" _
, 3, "Self Closing MsgBox", 64
End With
End Sub

seeya ste
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message Box Duration

Thank you - this works fine. I was also wondering if the message box ca
just show text, without the 'ok' button

TON

--
Message posted from http://www.ExcelForum.com

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message Box Duration

Nope
http://msdn.microsoft.com/library/de...wsmthpopup.asp

But I suppose you could put the function within a loop and keep showin
the dialog until you get a return value of -1 :

--
Message posted from http://www.ExcelForum.com

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
Format duration in mm/dd hh:mm Malkowiak.work Excel Worksheet Functions 4 July 27th 09 01:47 PM
duration Keith_river Excel Worksheet Functions 1 August 26th 08 04:46 AM
fx duration sajid Excel Worksheet Functions 1 May 5th 06 09:28 AM
Duration citizens1stbank Excel Discussion (Misc queries) 0 July 15th 05 06:23 PM
Duration Tess Excel Discussion (Misc queries) 2 February 1st 05 03:39 PM


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

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

About Us

"It's about Microsoft Excel"