Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Put a timer on a MsgBox?

Is vba able to put a timer on a MSgBox, so that OK is "clicked" after a
specified time and a macro/code can continue?

I have tried allsorts but with Msgbox one seems to get complete freezing of
the app and vba.

Any help much appreciated.

Joe


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Put a timer on a MsgBox?

Joe,

Use a custom form, and set the OnTime method when you initialise it to call
a proc that times out.

See OnTime in Help for details of that method.

--

HTH

Bob Phillips

"Joe 90" wrote in message
...
Is vba able to put a timer on a MSgBox, so that OK is "clicked" after a
specified time and a macro/code can continue?

I have tried allsorts but with Msgbox one seems to get complete freezing

of
the app and vba.

Any help much appreciated.

Joe




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Put a timer on a MsgBox?

Thanks Bob, I guess you have answered my question. I was trying to avoid
custom forms but if that's the only way to go, I'll go that way :)

Joe

"Bob Phillips" wrote in message
...
Joe,

Use a custom form, and set the OnTime method when you initialise it to

call
a proc that times out.

See OnTime in Help for details of that method.

--

HTH

Bob Phillips

"Joe 90" wrote in message
...
Is vba able to put a timer on a MSgBox, so that OK is "clicked" after a
specified time and a macro/code can continue?

I have tried allsorts but with Msgbox one seems to get complete freezing

of
the app and vba.

Any help much appreciated.

Joe






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Put a timer on a MsgBox?

Joe,

Set a reference to "Windows Script Host Object Model" and then use
code like

Dim SH As IWshRuntimeLibrary.WshShell
Set SH = New IWshRuntimeLibrary.WshShell
SH.Popup "Hello World", 5, "Title", vbYesNo

This will show a message box for 5 seconds, and then disappear,
returning the default value (Yes, in this example).


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Joe 90" wrote in message
...
Is vba able to put a timer on a MSgBox, so that OK is "clicked"

after a
specified time and a macro/code can continue?

I have tried allsorts but with Msgbox one seems to get complete

freezing of
the app and vba.

Any help much appreciated.

Joe




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Put a timer on a MsgBox?

Hi.

Try that.

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

If you want no button
set Const wButtons As Integer = 7 + 16

Alain CROS.

"Joe 90" a écrit dans le message de news: ...
Is vba able to put a timer on a MSgBox, so that OK is "clicked" after a
specified time and a macro/code can continue?

I have tried allsorts but with Msgbox one seems to get complete freezing of
the app and vba.

Any help much appreciated.

Joe




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
timer Steve[_9_] Excel Discussion (Misc queries) 4 January 28th 08 08:10 PM
Timer in VBA peyman Excel Discussion (Misc queries) 2 October 5th 07 06:53 PM
Timer Brandon H Excel Discussion (Misc queries) 5 August 9th 07 01:54 PM
Timer Vijay Excel Worksheet Functions 1 April 6th 07 11:00 AM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM


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