Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MsgBox que se cierre automaticamente

publicado

Buenas a todos,

Ante todo espero que estén bien.

Quería consultar sobre como podría hacer un msgbox que se cierre automáticamente después de ciertos segundos. Cabe decir que he buscado diferentes opciones y las pruebo y no se porque no me funciona, simplemente el msgbox queda allí y no se cierra.

Dejo acá las tres opciones que encontré pero que no me han funcionado, no sé si es que no he activado alguna librería. Quedo atento.
 

Option Explicit
Const TIMEOUT = 3 'Segundos
 
Sub MsgBoxTimer1()

Dim objShell As Object, intMsgBox As Variant

Set objShell = CreateObject("WScript.Shell")
 intMsgBox = objShell.Popup("Mensaje Temporizado en 3 Segundos.", TIMEOUT, "exceltrabajaporti.com", 64)

Set objShell = Nothing
 
End Sub

Sub MsgBoxTimer2()

Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)

End Sub

Sub MsgBoxTimer3()
    Dim AckTime As Integer, InfoBox As Object
    Set InfoBox = CreateObject("WScript.Shell")
    'Set the message box to close after 10 seconds
    AckTime = 3
    Select Case InfoBox.Popup("Click OK (this window closes automatically after 3 seconds).", _
    AckTime, "This is your Message Box", 0)
        Case 1, -1
            Exit Sub
    End Select
End Sub

 

Featured Replies

publicado
Hace 4 horas, manus dijo:

he buscado diferentes opciones y las pruebo y no se porque no me funciona

lo mismo que te sugería "allá"...

esta sola instrucción muestra el msgbox y se (auto)cierra a los 3 segundos (o los que indiques):

createobject("wscript.shell").popup "mensaje con tiempo limite", 3, "titulo"

las preguntas son:
- que botones quieres mostrar ?
- que acciones se siguen según lo que responda (o no) el usuario ?
- algún otro detalle "en el tintero" ?

publicado
  • Autor

Gracias a todos! Resulto!

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.