程序代码:
cDefPath = ADDBS(JUSTPATH(SYS(16))) SET DEFAULT TO (cDefPath) CREATE CURSOR tt (编号 c(10),姓名 c(10),出生年月 c(10),语文 I, 数学 I,英语 I) oExcel = CREATEOBJECT('Excel.Application') oExcel.DisplayAlerts = 0 FOR i=1 TO ADIR(aXLS,"*.xls") sh = oExcel.WorkBooks.Open(cDefPath + aXLS[i,1]).ActiveSheet sh.Rows("1:2").Delete row1 = oExcel.CountA(sh.Columns(1)) row2 = oExcel.CountA(sh.Columns(7)) arr1 = sh.Cells(1,1).Resize(row1,6).Value arr2 = sh.Cells(1,7).Resize(row2,6).Value INSERT INTO tt FROM ARRAY arr1 INSERT INTO tt FROM ARRAY arr2 oExcel.WorkBooks.Close ENDFOR oExcel.Quit SELECT * FROM tt