title: saving Textbox data to excel in vb.net
body: <p>I need help with saving user entered data (textbox) to an excel file. The excel file should be created on desktop automatically. I can add one textbox to excel but not multiple. If possible can you give code on being able to open the same file when btnopen is clicked, thank you! </p>
  
  <p>my code right now for save button.</p>
  
  <p>Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click</p>
  
  <pre><code>    SaveFileDialog.Filter = "CSV Files (*.csv*)|*.csv"
      If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK _
      Then
          My.Computer.FileSystem.WriteAllText _
          (SaveFileDialog.FileName, txtBMI.Text, True)
      End If
  
  
      table.Rows.Add(DateTimePicker1.Text, txtBMI.Text, txtHeight.Text, txtWeight.Text)
      DataGridView1.DataSource = table
  
  End Sub
  </code></pre>
  
  <ol>
  <li><a href="http://i.stack.imgur.com/H73M8.jpg" rel="nofollow">http://i.stack.imgur.com/H73M8.jpg</a></li>
  <li><a href="http://i.stack.imgur.com/Rjtjw.jpg" rel="nofollow">http://i.stack.imgur.com/Rjtjw.jpg</a></li>
  </ol>