ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timed Message Box Issue (https://www.excelbanter.com/excel-programming/370492-timed-message-box-issue.html)

MSweetG222

Timed Message Box Issue
 
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


Simon Lloyd[_881_]

Timed Message Box Issue
 

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

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=57204


MSweetG222

Timed Message Box Issue
 
Thank you, I will do that.
--
Thx
MSweetG222



"Simon Lloyd" wrote:


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

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=572040




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com