title: Listing assigned table names in Workbook using Excel interop
body: <p>I have an Excel Workbook that has several worksheets in it.  The tables in the worksheets have been assigned names using the Name Manager in Excel.  Is there a way to get a list of these table names, instead of the worksheet names?</p>
  
  <p>For instance, where workbook is defined as a Microsoft.Office.Interop.Excel.Workbook:</p>
  
  <pre><code>var names = (workbook.Names as System.Collections.IEnumerable).Cast&lt;Name&gt;();
  </code></pre>
  
  <p>returns a list of defined name ranges in the workbook.  Additionally:</p>
  
  <pre><code>var worksheets = workbook.Worksheets.Cast&lt;Worksheet&gt;();
  </code></pre>
  
  <p>returns a list of worksheets in the workbook, whose names are the same as the tab names of the worksheets.</p>
  
  <p>Neither of these list the tables by their assigned names.  They only list the tables by their worksheet name.  I hope I've made the question clear enough, but I can provide an example if need be.</p>