Select cb_zwhzgo topxlapp = getObject ('f: /temp/sqlinout.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 = 1select cb_zwhzdo 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 1enddo XLApp.SaveXlApp.Close