Dim myDGV As DataGridView = DataGridView1 myDGV.DataSource = Dt Dim path As String = "" Dim saveDialog As SaveFileDialog = New SaveFileDialog() saveDialog.DefaultExt = "xls" saveDialog.Filter = "Excel97-2003 (*.xls)|*.xls|All Files (*.*)|*.*" saveDialog.ShowDialog() path = saveDialog.FileName If path.IndexOf(":") < 0 Then Return Try Thread.Sleep(1000) Dim sw As StreamWriter = New StreamWriter(path, False, Encoding.GetEncoding("utf-8")) Dim sb As StringBuilder = New StringBuilder() For i As Integer = 0 To myDGV.Columns.Count - 1 If myDGV.Columns(i).HeaderText = "Name" Then sb.Append(myDGV.Columns(i).HeaderText.ToString().Trim() & vbCrLf) For j As Integer = 0 To myDGV.Rows.Count - 1 sb.Append(myDGV.Rows(j).Cells(i).Value & vbCrLf) Next End If Next sw.Write(sb.ToString()) sw.Flush() sw.Close() Catch ex As Exception MessageBox.Show(ex.Message) End Try