title: Trying to copy a worksheet to an existing workbook in vba
body: <p>I'm trying to copy data from a worksheet, opened from a CSV file, as a new worksheet in an existing Excel template.  I have tried copying to an existing, empty worksheet as well as copying the source worksheet in as a new sheet in the target workbook.  All of these methods have thrown a variety of errors.  The only method that actually allowed the code to complete was a copy-paste-special command.  However, it resulted in cells being filled with binary as opposed to values and many cells were filled with a grayed out appearance.</p>
  
  <p>Below is the code I have been trying to get working:</p>
  
  <pre><code>'=================================================
  'Add Data
  '=================================================
  Dim AppExcell As Object
  Dim wb As Object
  Dim xFile As String
  Dim main As Workbook
  
  Set AppExcel = CreateObject("Excel.Application")
  AppExcel.Visible = False
  
  Set wb = AppExcel.Workbooks.Add("C:\Fridge_Automation\Lab Report.xltm")
  Set main = ActiveWorkbook
  
  xFile = Application.GetOpenFilename("All CSV Files (*.csv),*.csv", , "Select CSV File")
  
  Set src = Workbooks.Open(xFile)
  
  src.Worksheets(1).Copy Before:=wb.Worksheets("11Mic Avg - Raw Data")
  wb.Worksheets(2).Name = "Raw Data"
  src.Close
  </code></pre>
  
  <p>I am running this code in Excel 2013 by clicking a button I have added to a worksheet.  </p>