您好!
您可以参见下面的代码:
下列代码适用于 Excel 97 和 Excel 2000:
Dim oConn As New ADODB.Connection
Dim oRs As New ADODB.Recordset
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Book1.xls;" & _
"Extended Properties=""Excel 8.0;"""
oRs.Open "Select * FROM [Sheet1$]", oConn
oConn.Execute "Insert Into [Sheet1$](field1,field2,.....) Values(......)"
oConn.Execute "Update [Sheet1$] Set field1=...... Where ......"
oConn.Execute "Delete From [Sheet1$] Where ......"
oRs.Close
Set oRs = Nothing
oConn.Close
Set oConn = Nothing