Import data in the VFP table into the specified Excel file

zhaozj2021-02-11  175

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

转载请注明原文地址:https://www.9cbs.com/read-5674.html

New Post(0)