改动下列代码,问题已解决。
If Isnull(eole.cells(k,(i-1)*6+1).Value)&&空值判断,如值为空则不继续读取
Exit
Endif
If Isnull(eole.cells(k,(i-1)*6+1).Value)&&空值判断,如值为空则不继续读取
Exit
Endif
cDefPath = ADDBS(JUSTPATH(SYS(16))) SET DEFAULT TO (cDefPath) USE bjd ZAP oExcel = CREATEOBJECT('Excel.Application') oExcel.DisplayAlerts = 0 sh = oExcel.WorkBooks.Open(cDefPath+"报价单.xlsx").Worksheets(1) c车型 = NVL(sh.Cells(2,2).Value,"") c车牌号 = NVL(sh.Cells(2,4).Value,"") c颜色代码 = NVL(sh.Cells(2,7).Value,"") c架子号 = NVL(sh.Cells(3,2).Value,"") c折扣 = NVL(sh.Cells(3,5).Value,"") c内饰颜色 = NVL(sh.Cells(3,7).Value,"") FOR i=5 TO sh.UsedRange.Rows.Count INSERT INTO bjd VALUES (c车型,c车牌号,c颜色代码,c架子号,c折扣,c内饰颜色,; sh.Cells(i,1).Value,; NVL(sh.Cells(i,2).Value,""),; NVL(sh.Cells(i,3).Value,""),; sh.Cells(i,4).Value,; sh.Cells(i,5).Value,; NVL(sh.Cells(i,6).Value,""),; NVL(sh.Cells(i,7).Value,""),; NVL(sh.Cells(i,8).Value,"")) ENDFOR oExcel.WorkBooks.Close oExcel.Quit SELECT * FROM bjd