Timed Message Box Issue

G

Guest

Hello,

I am using a variation of the code below (from
http://www.xldynamic.com/source/xld.xlFAQ0022.html).

My issue is: every once in a while, the message window is not on top (ie:
usually a user clicks another window). It seems that the popup timer stops
counting until the message window is back on top.

Question: Is there any way to keep the message window on top?

Example Code:
Private Const TM_TEXT As String = "Press OK or Cancel, or just wait to
timeout"
Private Const TM_TITLE As String = "Timed Msgbox Example"
Private Const TM_DURATION As Long = 5 'seconds
'-------------------------------------------------------------
Sub TimedMsgbox()
Dim WSH As Object
Set WSH = CreateObject("WScript.Shell")
Select Case WSH.Popup(TM_TEXT, TM_DURATION, TM_TITLE, vbOKCancel)
Case vbOK
MsgBox "You clicked OK"
Case vbCancel
MsgBox "You clicked Cancel"
Case -1
MsgBox "Timed out"
Case Else
End Select
End Sub
'---------------------------------------------------------------
Thank you for your help,

MSweetG222
 
S

Simon Lloyd

As far as i am aware the site you refer to belongs to or is run by Bo
Phillips perhaps directing your question his way may produce a
answer!

Regards,
Simo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top