title: Make Org Chart with interop excel
body: <p>I want to create an excel worksheet with an organizational chart with data from a database.</p>
  
  <p>I have played around with the interop excel library in a c# console application, but i am stuck. </p>
  
  <p>I can make a worksheet containing a smartart object with the hierachy chart layout(Org chart), but i dont know how to add my own data to it. When you create the chart it comes with the nodes shown in the picture below.</p>
  
  <p>Is it even possible to add you own data to the chart through the interop excel library?</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>    private static Excel.Workbook Wb = null;
      private static Excel.Application Xl = null;
      private static Excel.Worksheet Sheet = null;
  
      static void Main(string[] args)
      {
          Xl = new Excel.Application();
          Xl.Visible = true;
          Wb = Xl.Workbooks.Add();
          Sheet = Wb.Worksheets[1];
  
          var myLayout = Xl.SmartArtLayouts[88];
  
          var smartArtShape = Sheet.Shapes.AddSmartArt(myLayout, 50, 50, 200, 200);
  
          smartArtShape.AlternativeText = "Test";
  
      }
  </code></pre>
  
  <p>This is the result:
  <a href="https://i.stack.imgur.com/wg2GP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wg2GP.png" alt="enter image description here"></a></p>