Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim myCommand As New System.Data.OleDb.OleDbCommand()
Dim sql As String = Nothing
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\Test.xls; Extended Properties=""Excel 8.0;HDR=Yes;""")
MyConnection.Open()
myCommand.Connection = MyConnection
sql = "DELETE [Sheet1$] WHERE id=1"
myCommand.CommandText = sql
myCommand.ExecuteScalar()
MyConnection.Close()