title: C# Export Excel Chart as object (not as picture) to Word
body: <p>I want to export an excel chart to Word as an object (Excel Chart), not as a picture. As picture is very easy with Chart.CopyPicture</p>
  
  <p>I´m using AddOleObject, but it gives an error about not being able to link the file. This is the code:</p>
  
  <pre><code>Document doc; // Existing document
  string chartSheet = xlsFilePath + "!" + chartSheetName;
  string type = "Excel.Chart.8";
  InlineShape shape = doc.Content.InlineShapes.AddOLEObject(ClassType: type, FileName: chartSheet, LinkToFile: false, DisplayAsIcon: false);
  </code></pre>
  
  <p>I´ve seen a lot of posts about importing excel to word, but nothing uptodate or that works. </p>
  
  <p>For example:</p>
  
  <p><a href="https://stackoverflow.com/questions/1658935/c-create-insert-excel-2007-charts-into-word-2007" title="this on">This one</a> is what I´m trying to do, although instead of a workbook of 1 sheet with a chart, I have a book with many charts so I insert the chart like file.xls!chartSheetname</p>
  
  <p><a href="https://stackoverflow.com/questions/2672032/how-to-copy-a-formatted-cell-in-excel-to-a-table-cell-in-word-using-net">This other</a> uses copy and paste, only it inserts cells, not a chart. With chart, copy method copies the chart to antoher location in the workbook...</p>
  
  <p>And with <a href="http://vscontrols.blogspot.co.uk/2010/09/inline-chart-in-word-using-c-40.html" rel="nofollow noreferrer">this one</a> it adds an ole object to word, casts the object to a workbook, creates a worksheet and add data to that worksheet. But I already have the chart... I only want to insert an existing chart...</p>