Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim xlObj As New Excel.Application()
Dim xlBook As Excel.Workbook
xlBook = xlObj.Workbooks.Open("C:\Book1.xls")
xlBook.Sheets("Sheet1").Cells(1, 1).Value = DataGrid1.Item(DataGrid1.CurrentRowIndex, 1)///write the datagrid item to the excel sheet.
xlBook.Save() ///save the changes to the excel sheet item.
xlBook.Close()
xlObj.Quit()
End Sub