title: How to add the Chart sheet in Excel using C#
body: <p>I have created the sheet1 and populated some data in the sheet, using the data from sheet1 i want to create a chart sheet with ploting the data</p>
  
  <pre><code>try
  {
      app = new Excel.Application();
      app.Visible = true;
      workbook = app.Workbooks.Add(1);
      worksheet = (Excel.Worksheet)workbook.Sheets[1];
  
      PopulateDateInExcel(pathtologsfolder, startdate, enddate);
      // create a chart
  
      Excel.Range chartRange;
      object misValue = System.Reflection.Missing.Value;
      Excel.ChartObjects xlCharts = (Excel.ChartObjects)worksheet.ChartObjects(Type.Missing);
      Excel.ChartObject myChart = (Excel.ChartObject)workbook.Charts[2];
      Excel.Chart chartPage = myChart.Chart;
      chartRange = worksheet.get_Range("AN1", "AP6");
      chartPage.SetSourceData(chartRange, misValue);
      chartPage.ChartType = Excel.XlChartType.xl3DLine; 
  }
  catch (Exception e)
  {
      //Console.Write("Error");
  }
  finally
  {
  
  }
  </code></pre>
  
  <p>Thanks in advance,
  Excel Automation</p>