title: How to properly write and save a new Excel file?
body: <p>An application (a SCADA program) has an event that trigers every day and run a script that writes an Excel file (one for each day). The file could contain multiple sheets. </p>
  
  <p>On Windows 7, with Office 2007 installed, I can write, but I can't save and neither quit the <code>Excel.Application</code>.</p>
  
  <pre><code>Dim objExcel as Object
  Set objExcel = CreateObject("Excel.Application")
  objExcel.WorkBooks.Add  'I think I shouldn't do this, but if not it doesn't work
  
  Set sheet = objExcel.ActiveWorkBook.Worksheets.Add
  'writing to the actual sheet...
  
  objExcel.ActiveWorkBook.SaveAs path$
  objExcel.Workbooks.Close
  objExcel.Quit   
  </code></pre>
  
  <p>If I run the script manually (from the script editor):</p>
  
  <ul>
  <li>it saves</li>
  <li>the Excel process still runing</li>
  <li>When I open the Excel file (not from script), this has 2 workbooks,
  the actual and the last one from the last execution.</li>
  </ul>
  
  <p>If I try trigger the event:</p>
  
  <ul>
  <li>error occurs on the line when it saves</li>
  </ul>