Mostrar ventana emergente por un período de tiempo en Excel
Estoy tratando de generar en Excel VBA una ventana emergente que se cierra automáticamente después de un determinadoWaitTime
en segundos. He consultado el hilo "VBA Excel macro mensaje cuadro auto cierre" tanto comoesta yesta Enlaces. He tratado de aplicar el método del hilo de StackExchange citado; mi código es el siguiente:
Sub TestSubroutine()
Dim TemporalBox As Integer
Dim WaitTime As Integer
Dim WScriptShell As Object
Set WScriptShell = CreateObject("WScript.Shell")
WaitTime = 1
TemporalBox = WScriptShell.Popup("The message box will close in 1 second.", _
WaitTime, "File processed")
End Sub
Sin embargo, no parece estar funcionando, se muestra la ventana emergente pero nunca se cierra después de 1 segundo.
¿Alguien ve lo que estoy haciendo mal?
Editar # 1
Según el comentario de introducción de @Skip, he actualizado el código:
Sub TestSubroutine()
Dim WaitTime As Integer
WaitTime = 1
CreateObject("WScript.Shell").Popup "The message box will close in 1 second.", _
WaitTime, "File processed"
End Sub
Sin embargo, esto no resuelve el problema original, la ventana emergente no se cierra después de 1 segundo.
Editar # 2
Este es el código sugerido por @Glitch_Doctor, sin embargo, todavía no funciona:
Sub TestSubroutine()
Dim TemporalBox As Integer
Dim WaitTime As Integer
Dim WScriptShell As Object
Dim test
Set WScriptShell = CreateObject("WScript.Shell")
WaitTime = 1
Select Case TemporalBox = WScriptShell.Popup("The message box will close in 1 second.", _
WaitTime, "File processed")
Case 1, -1
End Select
End Sub