title: VBA Excel macro message box auto close
body: <p>I've an Excel macro that runs on opening the file, opens another excel file, refreshes the data, saves and then closes it.</p>
  
  <p>I also have a middle bit (Dim AckTime) that displays a pop up message for second to show  what it's done.</p>
  
  <p>BUT.. Since I set the macro to run on opening the workbook using Public Sub Workbook_Open() the message box pops up but will not close automatically on 1 second anymore.</p>
  
  <p>Can anyone help?</p>
  
  <pre><code>Public Sub Workbook_Open()
  
  Application.ScreenUpdating = False Application.DisplayAlerts = False
  Application.AskToUpdateLinks = False
  
       With Workbooks.Open("\\filename.xlsm")
           ActiveWorkbook.RefreshAll 'updates the data
           ActiveWorkbook.Sheets("Dashboard").Range("A2").Value = DateTime.Now 
           ' updates this cell with the current time
  
           Dim AckTime As Integer, InfoBoxWebSearches As Object
           Set InfoBoxWebSearches = CreateObject("WScript.Shell")
           AckTime = 1
           Select Case InfoBoxWebSearches.Popup("Updated, saving &amp; closing...", _
               Case 1, -1
           End Select
  
           .Save
           .Saved = True 'when saved..
           .Close 0 'close the file
  
       End With
  
  End Sub
  </code></pre>