select cb_zwhz
go top
xlapp = getobject(f:\temp qlinout.xls,excel.sheet)
xlapp.application.visible=.f.
xlapp.application. windows(“sqlinout.xls”).visible = .t.
xlsheet =xlapp.sheets[sheet1]
xlsheet.cells(1,1).value = “month”
xlsheet.cells(1,2).value = “zwcode”
xlsheet.cells(1,3).value = “qty”
xlsheet.cells(1,4).value = “cost”
xlsheet.cells(1,5).value = “money”
i=1
select cb_zwhz
do while not eof ()
xlsheet.cells(i+1,1).value=month
xlsheet.cells(i+1,2).value=zwcode
xlsheet.cells(i+1,3).value=qty
xlsheet.cells(i+1,4).value=cost
xlsheet.cells(i+1,5).value=money
skip
i=i+1
enddo
xlapp.save
xlapp.close
