Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ZCTT\20100805100119.xls;Extended Properties=Excel12.0"
Set rs = CreateObject("ADODB.Recordset")
rs.Open "Select count(时间) from [Sheet1$]",conn
Do
If Not rs.EOF Then
rd = rs("count(时间)")
rs.MoveNext
End If
Loop Until rs.EOF=True
conn.Close
Set rs =Nothing
若提示“未找到提供程序,该程序可能未正确安装”,这是因为未安装AccessDatabaseEngine.exe,自己下个安装一下就可以了 注:支持的操作系统: Windows Server 2003 Service Pack 1; Windows Vista; Windows XP Service Pack 2