Cerrar MsgBox en Automático

Obed

27/01/16

Facil y rapido

Haz tu trabajo con mucha rapidez y de manera más sencilla.

Ponte en contacto.

Soporte

Resuelve todas tus dudas y recibe la mejor asesoría en en los proyectos que desarrolles.

¡Contáctanos!

Reportes

Desempéñate mejor en tus tareas con nuestros reportes en Excel.

¡Te decimos como lograrlo!

>

En la siguiente rutina cada mensaje se mostrará por un máximo de 3 segundos, si el Usuario no hace click en el botón Aceptar el mensaje desaparecerá automáticamente de la pantalla.

'****************************************'
' Email: obed.cruz@exceltrabajaporti.com '
' www.exceltrabajaporti.com              '
' Excel VBA Developer                    '
'****************************************'
Option Explicit
'Value Button
'0 OK
'1 OK , Cancel
'2 Abort , Ignore, Retry
'3 Yes , No, Cancel
'4 Yes , No
'5 Retry , Cancel
'16 Critical
'32 Question
'48 Exclamation
'64 Information
Const TIMEOUT = 3 'Segundos
 
Sub MsgBoxTimer()
Dim objShell As Object, intMsgBox As Integer

Set objShell = CreateObject("WScript.Shell")
'Syntax  Popup(Text,[Time in seconds],[Title],[Value Button])
 intMsgBox = objShell.Popup("Mensaje Temporizado en 3 Segundos.", TIMEOUT, "exceltrabajaporti.com", 64)
 objShell.Popup "Informe de Disco completo...", TIMEOUT, , 64
 objShell.Popup "Informe de Memoria completo...", TIMEOUT, , 64
 objShell.Popup "Informe de CPU completo...", TIMEOUT, , 64

Set objShell = Nothing
 
End Sub

Copyright © 2022 Exceltrabajaporti.com - Todos los derechos reservados.