set fso=Server.CreateObject("scripting.FileSystemObject")
If fso.FileExists(SavePath) then '如果文件存在
Set xlsApp = CreateObject("Excel.application") '建立对象
xlsApp.Visible = False
Set xlsWb = xlsApp.Workbooks.Open(SavePath) '打开Excel
set xlsWs=xlsApp.Worksheets(1)
With xlsWs
'循环读取excel中的行现在设置只读25行。
'亦可设为do while 循环然后根据读取的某单元格数据为空即跳出循环。
for i=2 to 27
'读取表格各列数据
mkh=Trim(.Range("B" & i ))
jjjdk=Trim(.Range("C" & i ))
jx=Trim(.Range("E" & i ))
txh=Trim(.Range("F" & i ))
xlbh=Trim(.Range("G" & i ))
bz =Trim(.Range("H" & i ))
Where "HDR=Yes" means that there is a header row in the cell range
(or named range), so the provider will not include the first row of the
selection into the recordset. If "HDR=No", then the provider will include
the first row of the cell range (or named ranged) into the recordset.