title: Import CSV File to a new Excel Worksheet within an existing Excel Workbook
body: <p>I'm Trying to import 2 different CSV files into an excel workbook on 2 different worksheets. </p>
  
  <p>I've figured out how to create an excel workbook and import one of the CSV files. But when creating a new worksheet, I can't seem to import the 2nd CSV file into the new worksheet the same way that I imported the first CSV file.</p>
  
  <pre><code>$Excel = New-Object -ComObject Excel.Application
  $Excel.Visible = $true
  $Excel = $Excel.Workbooks.open(C:\Temp\CSVfile1.csv)
  
  #Create new worksheet and import 2nd CSV file
  $Excel.Worksheets.add()
  $Excel.Sheets(1).Name = 'Errors'
  $Excel2 = $Excel.Workbooks.open(C:\Temp\CSVfile2.csv)
  </code></pre>
  
  <p>The first CSV file import is successful. The 2nd worksheet is created, but the 2nd csv file is not imported.</p>
  
  <p>Error message displayed is </p>
  
  <p><code>You cannot call a method on a null-valued expression.</code></p>