回复 11楼 杂七杂八
SET TALK OFF
SET SAFETY OFF
CLEAR ALL
CLEAR
dir1=GETDIR()
SET DEFAULT TO &dir1.
CREATE CURSOR tt (编号 I, 姓名 C(10), 联系电话 C(20), 部门 C(10))
myexcel=createobject('excel.application')
myexcel.visible=.t.
FOR i=1 TO ADIR(xfile,"*.xls*")
bookexcel=myexcel.workbooks.open(dir1+xfile(i,1))
o_SheetName=myexcel.application.ActiveSheet.Name
sj=bookexcel.Worksheets(o_SHEETNAME).usedrange.value
FOR j=2 TO ALEN(sj,1)
APPEND BLANK
REPLACE 编号 WITH sj(j,1),姓名 WITH sj(j,2),联系电话 WITH sj(j,3),部门 WITH sj(j,4)
ENDFOR
myexcel.Activeworkbook.close(.F.)
myexcel.quit
ENDFOR
BROWSE
SET TALK ON
SET SAFETY ON
RETURN
以上代码测试可以通过
[此贴子已经被作者于2020-12-7 23:44编辑过]