Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInsertData.Click Dim MyConnection As New System.Data.OleDb.OleDbConnection Dim myCommand As New System.Data.OleDb.OleDbCommand Dim strSQL As String Try MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath("CustomerInformation.xls") & ";" & _ "Extended Properties=Excel 5.0;") MyConnection.Open() myCommand.Connection = MyConnection strSQL = "Insert into [Sheet1$] values('" + TextBox1.Text + "', '" + TextBox2.Text + "')" myCommand.CommandText = strSQL myCommand.ExecuteNonQuery() MyConnection.Close() Catch ex As Exception MsgBox(ex.ToString) Return End Try Response.Write("Record Enter Sucessfully") End Sub