title: C# Excel Interop - How to add a filter button in column header
body: <p>I'm finding some trouble with C# excel interop, and maybe someone can throw me some light about this.</p>
  <p>I want to add programatically a filter button at the column header just like this:</p>
  <p><a href="https://i.stack.imgur.com/7MJHI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7MJHI.png" alt="enter image description here" /></a></p>
  <p>I think it's related with the AutoFilter Method I've found <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.range.autofilter?view=excel-pia" rel="nofollow noreferrer">here</a>, but I can't make it work.</p>
  <p>I've tryed to add it to a range like this (and some other similar ways):</p>
  <pre><code>Excel.Range myRange = SheetActual.Range[SheetActual.Cells[3, 1], SheetActual.Cells[3, 11]];
  object result = myrange.AutoFilter(1, Type.Missing, XlAutoFilterOperator.xlAnd, Type.Missing, true);
  </code></pre>
  <p>but i'm not getting any success...  Any help will be appreciated. Thanks!</p>