谢谢大家的指导:
附上我自己的方法,
我是直接创建二个EXCEL对象查重的。
loXls = CREATEOBJECT("excel.application")
loXls.Workbooks.OPEN(thisform.text1.Value)
loXls.ActiveSheet.COLUMNS(1).Insert
nrows=loxls.Worksheets('Sheet1')
UsedRange =nrows.UsedRange
H1 = UsedRange.ROWS.COUNT
&&&&表一行数H1
******************************************************************************************
loXlse = CREATEOBJECT("excel.application")
loXlse.Workbooks.OPEN(thisform.text2.Value)
nrows2=loxlse.Worksheets('Sheet1')
UsedRange2 =nrows2.UsedRange
H2 = UsedRange2.ROWS.COUNT
&&&&表二行数H2
PUBLIC j
j=1
PUBLIC i
i=0
BJ1="重"
BJ2="不重"
DO WHILE i<H1
i=i+1
Z1=ALLTRIM(loxls.CELLS(i,2).value)
thisform.text5.Value=i
thisform.text6.Value=H1
Z2=ALLTRIM(loxlsE.CELLS(j,1).value)
DO WHILE Z1$Z2=.F. .AND. j<H2
j=j+1
Z2=ALLTRIM(loxlsE.CELLS(j,1).value)
ENDDO
IF Z1$Z2=.T.
loxls.CELLS(i,1).value=BJ1
ELSE
loxls.CELLS(i,1).value=BJ2
ENDIF
j=1
ENDDO
*loxls.WorkBooks.Close
************************************************退出二个EXCEL对象*****************
LOXLS.ActiveWorkbook.saved=.f.
LOXLS.WorkBooks.Close
LOXLS.quit
&&&&关表一
LOXLSe.ActiveWorkbook.saved=.t.
LOXLSe.WorkBooks.Close
LOXLSe.quit
&&&&&&关表二
*******************************************