title: Excel VBA: Copying Worksheet to Existing Workbook (variable)
body: <p>I want to store an active workbook as a variable so that I can call upon that same workbook even if the name changes. Then, I would like to open another workbook and copy the first sheet into the existing workbook. </p>
  
  <p>Here is the relevant portion:</p>
  
  <pre><code>Dim WorkbookA As Workbook
       Set WorkbookA = ActiveWorkbook.Name
  
  
  folder = Application.GetOpenFilename("Excel (*.xlsx), *.xlsx", 1, "Select file")
  Workbooks.Open Filename:=folder
  
      NewFile = Dir(folder)
      Workbooks(NewFile).Activate
  
  ActiveSheet.Select
  ActiveSheet.Copy Before:=Workbooks(WorkbookA).Sheets(1)
  </code></pre>
  
  <p>The error message I keep getting is related to setting WorkbookA to the active workbook. </p>
  
  <p>Any help is greatly appreciated!</p>