Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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
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
code -message box not messaging Wanna Learn Excel Discussion (Misc queries) 1 January 21st 09 05:03 PM
code break message box freekrill Excel Discussion (Misc queries) 2 November 29th 05 05:26 PM
Interrupt find and replace Richard Excel Worksheet Functions 1 October 18th 05 01:32 AM
Excel compare workbooks: need to interrupt and resume sync scroll Al in Ladner Excel Discussion (Misc queries) 0 June 14th 05 07:25 PM
how to prevent user to interrupt macro Jerome LT Excel Programming 2 August 13th 03 10:28 AM


All times are GMT +1. The time now is 04:12 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"