比如说:
我百度到了一段,谁帮我纠错一下
if used temp.dbf then
select
select 0
use temp.dbf
mypath=('d:\data')
myfile=dir(mypath&"*.xlsx")
myexcel=creatobject('excel application')
myexcel.visiable=.f.
do while myfile<>""
mybook=myexcel.workbooks.open(mypath&myfile)
UsedRange =bookexcel.worksheets(o_SheetName).UsedRange
o_rows=UsedRange.rows.count
&&汇总行
FOR i=2 TO o_rows
m1=myexcel.cells(i,1).value
m2=myexcel.cells(i,2).value
m3=myexcel.cells(i,3).value
m4=myexcel.cells(i,4).value
m5=myexcel.cells(i,5).value
APPEND BLANK
REPLACE DATE WITH m1,SELLER WITH m2,BUYER WITH m3,AMOUNT WITH m4,PRODUCT WITH m5
ENDFOR
ENDWHILE
Myexcel.workbooks.close
myexcel.quit