title: vba: open workbook and change sheet name
body: <p>I am trying to copy a sheet and after this, open the copy to change the first sheet's name.</p>
  
  <p>This is the code inserted on <code>Module1</code>:</p>
  
  <pre><code>Sub CopiarNovaPlanilha()
  Dim wkb As Workbook
  
  ActiveWorkbook.SaveCopyAs "I:\CGP\DEOPEX\01 - Supervisão\10 - Alocação das equipes\Consulta Alocados\ALOCACAO TECNICOS.xlsx"
  
  Set wkb = Workbooks.Open("I:\CGP\DEOPEX\01 - Supervisão\10 - Alocação das equipes\Consulta Alocados\ALOCACAO TECNICOS.xlsx")
  wkb.Sheets(1).Name = "FUNCIONARIOS"
  
  End Sub
  </code></pre>
  
  <p>The first part of the <code>Sub</code> to save a copy works perfectly. Although when I try to run the second part it gives me the following error:</p>
  
  <blockquote>
    <p>Run-time error 1004: Excel cannot open the file</p>
  </blockquote>
  
  <p>And it says that it can't understand the extension <code>.xlsx</code> or that maybe the file is corrupted, but I've checked and the file is ok.</p>
  
  <p>Does anyone knows which problem is that?</p>