这段不打开EXCEL读写数据的VBA代码如何改成VB代码?
Sub Test()With CreateObject("ADODB.connection")
.Open "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='Excel 8.0;HDR=NO;';Data Source=" & ThisWorkbook.Path & "\W.XLS"
arr = .Execute("select * from [SHEET1$H5:H5]").getrows
.Execute "UPDATE [SHEET1$H5:H5] SET F1='" & arr(0, 0) + 1 & "'"
.Close
End With
End Sub --------------------编程问答-------------------- 只要把ThisWorkbook.Path换成正确的路径即可。
补充:VB , 非技术类