title: epplus part already exists
body: <p>I want to update (add another sheet and add chart) an existing xlsx file by using epplus excel package. However, I got an error in following line</p>
  
  <pre><code>var pieChart = worksheet.Drawings.AddChart("Chart1", OfficeOpenXml.Drawing.Chart.eChartType.Pie);
  </code></pre>
  
  <blockquote>
    <p>Error : An unhandled exception of type
    'System.InvalidOperationException' occurred in EPPlus.dll Additional
    information: Part already exist</p>
  </blockquote>
  
  <p>Can anyone help me? Thank you in advance.</p>
  
  <pre><code>using (ExcelPackage pck = new ExcelPackage())
              {
         using (FileStream stream = new FileStream("Report.xlsx", FileMode.Open))
                  {
                      pck.Load(stream);
  
                      ExcelWorksheet worksheet = pck.Workbook.Worksheets.Add("1");
  
                      var data = new List&lt;KeyValuePair&lt;string, int&gt;&gt;
      {
          new KeyValuePair&lt;string, int&gt;("Group A", 44613),
          new KeyValuePair&lt;string, int&gt;("Group B", 36432),
          new KeyValuePair&lt;string, int&gt;("Group C", 6324),
          new KeyValuePair&lt;string, int&gt;("Group A", 6745),
          new KeyValuePair&lt;string, int&gt;("Group B", 23434),
          new KeyValuePair&lt;string, int&gt;("Group C", 5123),
          new KeyValuePair&lt;string, int&gt;("Group A", 34545),
          new KeyValuePair&lt;string, int&gt;("Group B", 5472),
          new KeyValuePair&lt;string, int&gt;("Group C", 45637),
          new KeyValuePair&lt;string, int&gt;("Group A", 37840),
          new KeyValuePair&lt;string, int&gt;("Group B", 20827),
          new KeyValuePair&lt;string, int&gt;("Group C", 4548),
      };
  
                      //Fill the table
                      var startCell = worksheet.Cells[1, 1];
                      startCell.Offset(0, 0).Value = "Group Name";
                      startCell.Offset(0, 1).Value = "Value";
  
                      for (var i = 0; i &lt; data.Count(); i++)
                      {
                          startCell.Offset(i + 1, 0).Value = data[i].Key;
                          startCell.Offset(i + 1, 1).Value = data[i].Value;
                      }
  
                      //Add the chart to the sheet
                      var pieChart = worksheet.Drawings.AddChart("Chart1", OfficeOpenXml.Drawing.Chart.eChartType.Pie);
                      pieChart.SetPosition(data.Count + 1, 0, 0, 0);
                      pieChart.Title.Text = "Test Chart";
                      pieChart.Title.Font.Bold = true;
                      pieChart.Title.Font.Size = 12;
  
  
  
                      pck.Save();
                  }
  </code></pre>