cDefPath = ADDBS(JUSTPATH(SYS(16))) SET DEFAULT TO (cDefPath) COPY FILE 订货模板.xls TO tmp.xls excel = CREATEOBJECT("Excel.Application") excel.DisplayAlerts = 0 sh = excel.WorkBooks.Open(cDefPath+"tmp.xls").Worksheets(1) sh.Rows("5:"+TRANSFORM(sh.UsedRange.Rows.Count)).Clear USE bjd SCAN sh.cells(RECNO()+4,1).value = 零部件编码 sh.cells(RECNO()+4,6).value = 数量 ENDSCAN ** excel.WorkBooks.Close ** excel.Quit excel.Visible = 1