title: Filtering excel dates in VB.net
body: <p>I have a very simple line of code that works in Excel VBA, but I can't for the life of me figure out how it works in VB.NET. Any help would be appreciated.</p>
  
  <pre><code> Selection.AutoFilter Field:=8, Criteria1:="&gt;=" &amp; sdate
  </code></pre>
  
  <p>edit: complete code</p>
  
  <pre><code> Dim sDate as Date
   Dim xlapp As New Excel.Application
   sdate = DateTimePicker1.Value.Date
   OpenFileDialog1.Filter = "Excel Documents | *.xls; *.xlsx; *.xlsxm"
   If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
   xlWB= xlapp.Workbooks.Open(OpenFileDialog1.FileName)
  
   xlWB.Worksheets("Data").Range("H1").Select()
   xlapp.Selection.AutoFilter()               
   xlapp.Selection.AutoFilter(Field:=8, Criteria1:="=&gt;" &amp; sDate)
  </code></pre>