title: VBS Doesn't stop running
body: <p>I have a scheduled task that launches a vb script which in turn runs a macro within excel.  Everything runs fine (as in I get the results I want), however, the scheduled task remains 'running' and therefore doesn't start again the next morning.  The VB Script is as follows:</p>
  
  <pre><code>Option Explicit
  
  Dim xlApp, xlBook
  
  Set xlApp = CreateObject("Excel.Application")
  Set xlBook = xlApp.Workbooks.Open("C:\MyPath\My File.xlsm", 0, True)
  xlApp.Run "myMacro"
  xlBook.Close
  xlApp.Quit
  
  Set xlBook = Nothing
  Set xlApp = Nothing
  
  WScript.Quit
  </code></pre>
  
  <p>The end of the Macro (all the preceding code work and saves my csv output as required):</p>
  
  <pre><code>        Workbooks("My File.xlsm").Activate
          Worksheets("Outputs").Select
          'ActiveWorkbook.Save
          'ActiveWorkbook.Close - this line cause vbs to fail after creating my csv
          Application.ScreenUpdating = True
          Application.DisplayAlerts = True
  
      End Sub
  </code></pre>
  
  <p>How do I terminate the VB Script to stop the scheduled task from running?</p>