Fechar MsgBoxs automáticamente por JoseA
Código: Selecionar todos
Global oSHL As Object
Sub AutoCloseMsgBox(Mensagem As String, Titulo As String, Segundos As Integer)
Set oSHL = CreateObject("WScript.Shell")
oSHL.PopUp Mensagem, Segundos, Titulo, vbOKOnly + vbInformation
End Sub
Sub AutoMessage()
'Fechar MsgBoxs automáticamente por JoseA
'Call Envia_A
AutoCloseMsgBox "Msgbox1 - Clique em OK ou aguarde 2 segundos", "Fechar MsgBox1 automaticamente", 2 '2 segundos
'Call Envia_B
AutoCloseMsgBox "Msgbox2 - Clique em OK ou aguarde 3 segundos", "Fechar MsgBox2 automaticamente", 3 '3 segundos
'Call Envia_C
AutoCloseMsgBox "Msgbox3 - Clique em OK ou aguarde 4 segundos", "Fechar MsgBox3 automaticamente", 4 '4 segundos
'Call Envia_D
AutoCloseMsgBox "Msgbox4 - Clique em OK ou aguarde 5 segundos", "Fechar MsgBox4 automaticamente", 4 '5 segundos
End Sub
Essa dica foi postada no site abaixo, no mesmo temos uma outra dica utilizando-se APIS, mas optei por essta por ter menos linhas e ser mais simples.
MsgBox com Time
http://www.vbaexcelforum.com/showthread ... 2615713e22
[]s