patrickão
03-10-2014 13:16:13
Olá Pessoal. Gostaria da ajuda de vocês para solucionar um problema que venho tendo com autoclosemessagebox.
Gostaria de MsgBox fechasse automaticamente (tempo pré determinado). Consegui alguns códigos na net que ensinam a fazer isso, mas quando aplico no meu programa, a mesma não fecha automaticamente. Gostaria de gerar uma msgbox depois que um gráfico fosse plotado e o q a mesma fechasse após 1 segundo.
Segue o código:
Global oSHL As Object
Sub AutoCloseMsgBox(Mensagem As String, _
Titulo As String, Segundos As Integer)
'MsgBox que fecha automaticamente
Set oSHL = CreateObject("WScript.Shell")
oSHL.PopUp Mensagem, Segundos, Titulo, _
vbOKOnly + vbInformation
End Sub
Sub Macro1()
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Gráfico"""
ActiveChart.SeriesCollection(1).XValues = Plan1.Range("A3,B3")
ActiveChart.SeriesCollection(1).Values = Plan1.Range("A3,C3")
Application.ScreenUpdating = True
Application.Wait (Now + TimeValue("0:00:01"))
AutoCloseMsgBox "Gerou o Gráfico", "Gráfico", 1
End Sub
Abraço!!!
Gostaria de MsgBox fechasse automaticamente (tempo pré determinado). Consegui alguns códigos na net que ensinam a fazer isso, mas quando aplico no meu programa, a mesma não fecha automaticamente. Gostaria de gerar uma msgbox depois que um gráfico fosse plotado e o q a mesma fechasse após 1 segundo.
Segue o código:
Global oSHL As Object
Sub AutoCloseMsgBox(Mensagem As String, _
Titulo As String, Segundos As Integer)
'MsgBox que fecha automaticamente
Set oSHL = CreateObject("WScript.Shell")
oSHL.PopUp Mensagem, Segundos, Titulo, _
vbOKOnly + vbInformation
End Sub
Sub Macro1()
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Gráfico"""
ActiveChart.SeriesCollection(1).XValues = Plan1.Range("A3,B3")
ActiveChart.SeriesCollection(1).Values = Plan1.Range("A3,C3")
Application.ScreenUpdating = True
Application.Wait (Now + TimeValue("0:00:01"))
AutoCloseMsgBox "Gerou o Gráfico", "Gráfico", 1
End Sub
Abraço!!!