clear
close databases
set safety off
eole = CREATEOBJECT("Excel.Application")
eole.Workbooks.Open("D:\群问题\123.xls")
nrows=eole.activesheet.usedrange.rows.count && 有效行
ncols=eole.activesheet.usedrange.columns.count && 有效列
local asj[nrows-1,ncols]
for i=2 to nrows
for ii=1 to ncols
asj[i-1,ii]=eole.SHEETS(1).CELLS(i,ii).text
endfor
endfor
eole.quit
RELEASE eole
use s123 in 0
zap
append from array asj
browse
方法二:先另存为txt文件再追加到DBF中
clear
close databases
set safety off
eole = CREATEOBJECT("Excel.Application")
eole.Workbooks.Open("D:\群问题\123.xls")
eole.DisplayAlerts = .f.
eole.ActiveWorkbook.SaveAs("D:\群问题\123.txt",-4158)
eole.DisplayAlerts = .t.
eole.ActiveWorkbook.Close(.f.)
eole.quit
RELEASE eole
use s123 in 0
zap
append from 123.txt DELIMITED with tab
delete record 1
pack
browse
erase 123.txt