title: Method invocation failed because [System.__ComObject] does not contain a method named 'Close' in Powershell v4.0
body: <p>this is my first StackOverflow question, but I will try to keep the community standards in mind..</p>
  
  <p>I am running Office 2013 on Win7 Pro and PoSh v4.0. Upon execution of the subsequent script, I receive the following error: <strong>"Method invocation failed because [System.__ComObject] does not contain a method named 'Close'."</strong> </p>
  
  <pre><code>$xl = New-Object -comobject Excel.Application
  $xl.Visible = $false
  $xl.DisplayAlerts = $false
  $filepath = "C:\Users\rysullivan\Desktop\Projects\EDCautomation\attach\"
  $wb1 = $xl.Workbooks.Open((Join-Path $filepath "Ryan Sullivan-Template.xlsx"))
  sleep 5
  $wb1.Close()
  [System.Runtime.Interopservices.Marshal]::ReleaseComObject($xl)
  </code></pre>
  
  <p>In keeping with the standard of presenting the shortest code that will reproduce the error, I developed the above code down from a larger automation </p>
  
  <p><a href="https://stackoverflow.com/questions/20325785/powershell-4-0-and-excel-2013-bug-work-a-round">Powershell 4.0 and Excel 2013 | Bug | Work-a-round</a>  seemed to be getting at the same point. I followed the thread/culture solution offered by XXInvidiaXX and the same error was generated.</p>
  
  <p><a href="https://stackoverflow.com/questions/458852/problems-with-excel-automation-in-powershell">Problems with Excel automation in PowerShell</a>  had an answer by Roy that pointed to a timing error, but I inserted a Sleep command and tried running the open and close commands separately, both to no avail.</p>
  
  <p>Any help, especially underlying theory, is greatly appreciated.</p>