title: How to open a Workbook with a password, disable events
body: <p>How to open a Workbook with a password, disable events, 
  and then copy a sheet in background to the second file and save.
  I need in VBA, working in a MS-Access and Excel files</p>
  
  <p>I have done this until now, is working.</p>
  
  <pre><code>Private Sub TestFunction()
  
  'strPath = CurrentDb.Properties(0)
  'strPath = Left(strPath, Len(strPath) - Len(Dir(strPath, vbNormal))) &amp; "Temp\"
  Dim CopyFrom As Object
  Dim CopyTo As Object ''Early binding: Workbook
  Dim CopyThis As Object
  Dim xl As Object ''Early binding: New Excel.Application
  
  Set xl = CreateObject("Excel.Application")
  xl.Visible = True
  Set CopyFrom = xl.Workbooks.Open("D:\A01.xls")
  'CopyFrom.EnableEvents = False
  Set CopyThis = CopyFrom.Sheets(1) ''Sheet number 1
  Set CopyTo = xl.Workbooks.Open("D:\PM1.xls")
  CopyThis.Copy After:=CopyTo.Sheets(CopyTo.Sheets.Count)
  CopyFrom.Close
  End Sub
  </code></pre>
  
  <p>This opens the Excel, I enter the pass copy's the sheet to second File.</p>
  
  <p>But I need to pass the password in background,  delete the sheet and save the second file, all in background.
  Also I need to delete a sheet, without asking me, like :</p>
  
  <pre><code>CopyTo.Sheets("Sheet1").Delete
  </code></pre>
  
  <p>Thank you</p>