Msgbox VBA + minuterie
Dergoshine
-
eriiic Posted messages 24581 Registration date Status Contributeur Last intervention -
eriiic Posted messages 24581 Registration date Status Contributeur Last intervention -
Hello,
I would like that when you click on my button on my Excel sheet, a msg box opens, asks the user to wait and closes after a predefined period of time before displaying a result.
If possible, I would like the user to see the timer on the msg box (for example, the seconds counting down) and that after the time has elapsed, the msg box closes by itself to display the result.
Thank you in advance for your help.
I would like that when you click on my button on my Excel sheet, a msg box opens, asks the user to wait and closes after a predefined period of time before displaying a result.
If possible, I would like the user to see the timer on the msg box (for example, the seconds counting down) and that after the time has elapsed, the msg box closes by itself to display the result.
Thank you in advance for your help.
3 réponses
you shouldn't dream, you won't have interaction in a msgbox ...
you need to open a new window with a one-second timer to display the time and a test on the cumulative ...
it's simple, but well, I don't know vb that well anymore. it's click and load events that need to be managed ...
you need to open a new window with a one-second timer to display the time and a test on the cumulative ...
it's simple, but well, I don't know vb that well anymore. it's click and load events that need to be managed ...
Hello,
Is it just to force the user to wait, or do you want a procedure to take place during the countdown?
--
Best regards,
Franck P
Is it just to force the user to wait, or do you want a procedure to take place during the countdown?
--
Best regards,
Franck P
Temporary MsgBox:
Sources Code:
To display a countdown, you should no longer use a MsgBox, but create one yourself using UserForms. Sources and the code to use:
example
Sources Code:
CreateObject("Wscript.shell").Popup "My Text", 3, "The Title"3 = 3 seconds..... To display a countdown, you should no longer use a MsgBox, but create one yourself using UserForms. Sources and the code to use:
Dim i As Integer With UserForm1 .Show 0 For i = 10 To 0 Step -1 Application.Wait Now + TimeValue("00:00:01") .Label1 = i .Repaint Next End With example
Good evening,
pijaku had to be absent and asked me to take over your question.
Neither does his file work as expected on my end (2003).
Here is another proposal largely inspired by Jacques Boisgontier's website:
http://boisgontierjacques.free.fr/pages_site/formulairebases.htm#barreAttente
Time is ticking by, but for that, the dialog box must be non-modal.
This implies that the user can use/edit the workbook while it is displayed.
Apart from adding maximum protection to the sheets before displaying the dialog box and removing that protection after it is closed, I don't see any other solutions.
Otherwise, give up on showing the time. Unless someone knows how to make a dialog box active... I haven't found it and it's getting late ;-)
http://www.cijoint.fr/cjlink.php?file=cj201108/cijqMbBdKe.xls
eric
pijaku had to be absent and asked me to take over your question.
Neither does his file work as expected on my end (2003).
Here is another proposal largely inspired by Jacques Boisgontier's website:
http://boisgontierjacques.free.fr/pages_site/formulairebases.htm#barreAttente
Time is ticking by, but for that, the dialog box must be non-modal.
This implies that the user can use/edit the workbook while it is displayed.
Apart from adding maximum protection to the sheets before displaying the dialog box and removing that protection after it is closed, I don't see any other solutions.
Otherwise, give up on showing the time. Unless someone knows how to make a dialog box active... I haven't found it and it's getting late ;-)
http://www.cijoint.fr/cjlink.php?file=cj201108/cijqMbBdKe.xls
eric