title: Display popup for a time period in Excel
body: <p>I am trying to generate a popup that closes after a given <code>WaitTime</code> in seconds.</p>
  
  <p>I consulted <a href="http://www.tushar-mehta.com/publish_train/xl_vba_cases/1023_display_message_for_a_specific_duration.shtml" rel="nofollow noreferrer">this</a> link and <a href="https://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx" rel="nofollow noreferrer">this</a> link.</p>
  
  <p>I tried to apply the method from "<a href="https://stackoverflow.com/questions/19008288/vba-excel-macro-message-box-auto-close">VBA Excel macro message box auto close</a>"; my code is the following:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The popup is displayed but it never closes after one second.</p>
  
  <hr>
  
  <p><strong>Edit #1</strong></p>
  
  <p>Based on @Skip Intro comment, I have updated the code:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>However this does not solve the original issue, the popup does not close after 1 second.</p>
  
  <p><strong>Edit #2</strong></p>
  
  <p>This is the code suggested by @Glitch_Doctor, however it still doesn't work:</p>
  
  <pre><code>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
  </code></pre>