title: Error when closing an opened workbook in VBA Userform
body: <p>In a subroutine, I want to open a workbook, do some reading from it, and close it.<br>
  For some reason, I get an error:</p>
  
  <pre><code>Run-time error '1004':
  
  Method 'Close' of object _Workbook failed
  </code></pre>
  
  <p>I have identified a minimal code snippet to reproduce the problem.<br>
  Create a fresh excel file. In it, create a Userform. On that, create a Command Button with the following Click event code:</p>
  
  <pre><code>Private Sub CommandButton1_Click()
      Dim filename As String
      Dim opened_workbook As Workbook
  
      filename = Application.GetOpenFilename()    ' User selects valid Excel file
      Set opened_workbook = Application.Workbooks.Open(filename)
      ' File operations would occur here
      opened_workbook.Close    ' Exception thrown here
  
      MsgBox "If you got here, it worked!"
      Unload Me
  End Sub
  </code></pre>
  
  <p>What really perplexes me is that this error doesn't happen with the same code when the Command button is not on a userform (on a plain button straight on the worksheet).</p>
  
  <p>I don't even know what else to report or where to look to explain this behavior (besides StackOverflow!). I'm writing VBA using Excel for Mac 2011 and can move to Windows Excel 2010 if it makes a difference.</p>