Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format duration in mm/dd hh:mm | Excel Worksheet Functions | |||
duration | Excel Worksheet Functions | |||
fx duration | Excel Worksheet Functions | |||
Duration | Excel Discussion (Misc queries) | |||
Duration | Excel Discussion (Misc queries) |