VBA Excel - Timed Messaged Box Will Not Close after time is Up

17 Views Asked by At

In VBA Excel, I have created a timed message box using the WScript.Shell .Popup method, but for some reason my message box will not close after the pre-determined 3 seconds. Any clues what I'm doing wrong? Thanks!

Dim TimedMsgBox As Object
Dim MsgBoxText As String
Dim timeDelay As Integer
timeDelay = 3
MsgBoxText = "Sorry, but the tab for " & WS.Name & " is protected; rerun this macro after unprotecting it."
Set TimedMsgBox = CreateObject("WScript.Shell")
TimedMsgBox.Popup MsgBoxText, timeDelay, "Warning", 48
0

There are 0 best solutions below