Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message box that does not interrupt code
Hi all,
Is it possible to configure the msgbox() in such a way that a message is displayed (say for a few seconds, or until another event takes place), without interrupting the execution of the code? Thanks in advance! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message box that does not interrupt code
Here is one I found in the archives
http://tinyurl.com/qgdb Sub TimedMessage() Const Title As String = "Self closing message box" Const Delay As Byte = 2 ' Tps d'affichage en secondes Const wButtons As Integer = 16 ' Boutons + icone Dim wsh As Object, msg As String Set wsh = CreateObject("WScript.Shell") msg = Space(10) & "Bonjour," & vbLf & vbLf & "Nous sommes le " & Date wsh.Popup msg, Delay, Title, wButtons Set wsh = Nothing End Sub "Claude" wrote in message ... Hi all, Is it possible to configure the msgbox() in such a way that a message is displayed (say for a few seconds, or until another event takes place), without interrupting the execution of the code? Thanks in advance! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message box that does not interrupt code
Here's a link that discusses some options.
http://www.google.com/groups?num=50&...=Google+Search ================================================== ========================= Sub DisplayMessageWScript() '' Display a MsgBox for two seconds. Dim intSec As Integer Dim WshShell2 As Object Dim strText As String, strTitle As String intSec = 2 strTitle = "PopUp Message" strText = "Displays for " & intSec & " second." Set WshShell2 = CreateObject("WScript.Shell") WshShell2.Popup strText, intSec, strTitle End Sub ================================================== ========================= Sub DisplayMessageWSH() '' Set a reference to "Windows Script Host Object Model" Dim SH As IWshRuntimeLibrary.WshShell Set SH = New IWshRuntimeLibrary.WshShell SH.Popup "Hello World", 5, "Title", vbYesNo End Sub ================================================== ========================= Watch for linewrap here. Just call this routine with the string that you wish to display. Sub DisplayTextBox(strShow As String) '' Displays a text box for a given amount of time. Dim intLen As Integer Dim shpTB As Shape Application.ScreenUpdating = True intLen = Len(strShow) Set shpTB = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 0, 0, 140, 15) With shpTB .Top = ActiveWindow.VisibleRange.Top + 250 .Left = ActiveWindow.VisibleRange.Left + 350 .Width = intLen * 5 .Fill.ForeColor.SchemeColor = 8 With .TextFrame.Characters .Text = strShow With .Font .ColorIndex = 4 .FontStyle = "Bold Italic" .Size = 9 End With End With End With Application.Wait (Now + TimeValue("0:00:03")) shpTB.Delete End Sub HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- Is it possible to configure the msgbox() in such a way that a message is displayed (say for a few seconds, or until another event takes place), without interrupting the execution of the code? Thanks in advance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code -message box not messaging | Excel Discussion (Misc queries) | |||
code break message box | Excel Discussion (Misc queries) | |||
Interrupt find and replace | Excel Worksheet Functions | |||
Excel compare workbooks: need to interrupt and resume sync scroll | Excel Discussion (Misc queries) | |||
how to prevent user to interrupt macro | Excel Programming |