title: .vbs (script) for copying a whole sheet from a file to another file
body: <p>What .vbs code could I use to copy a whole sheet from an excel file to another?</p>
  
  <p>I've tried using the following, but lines 2 and 3 pop an error (<a href="https://i.stack.imgur.com/AQTO7.png" rel="nofollow noreferrer">Error Image</a>), and without them, the script runs but does nothing.</p>
  
  <pre><code>    Sub Copy_Sheet()
      Dim x As Workbook
      Dim y As Workbook
  
      Set x = Workbooks.Open("C:\File1.xls")
      Set y = Workbooks.Open("C:\File2.xlsx")
  
      y.Sheets("Sheet1").Range("A1").Value = x.Sheets("Sheet1").Range("A1")
  
      y.Save
      y.close
      x.Close
  
      End Sub
  </code></pre>