title: VB.Net - Select an Excel Worksheet, after using a Browse button
body: <p>I have a Browse button code, that when I browse to an Excel file, I then want to be able to select a particular worksheet for that file manually so I can then import that particular sheet into a Datagridview.
  I am trying to use either a combobox or a listbox.</p>
  
  <p>My plans are to use the Browse button to populate a Textbox, then via that textbox, select a worksheet, then import it to a Datagridview for review, before exporting it to a SQL Database table.</p>
  
  <p>I have to code for the browse button, I can import the file to a dataviewgrid,and export it to SQL. But only if the Excel file has a Single "predefined" worksheet name.
  I need the worksheet selectable after the browse but before the Datagridview import.
  This is my Browse Button Code.I am guessing its to simplistic for the takes and must load the file first.</p>
  
  <pre><code>    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
      Dim fd As OpenFileDialog = New OpenFileDialog()
      Dim strFileName As String
  
      fd.Title = "Open File Dialog"
      fd.InitialDirectory = "H:\COST ACCTG\Inventory\"
      fd.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"
      fd.FilterIndex = 2
      fd.RestoreDirectory = True
  
      If fd.ShowDialog() = DialogResult.OK Then
          strFileName = fd.FileName
      End If
  
      TextBox1.Text = strFileName
  
  End Sub
  </code></pre>