请问如何将EXCEL文件导入PB的数据窗口中,要求去掉标题行和字段行
------解决思路----------------------
oleobject excelserver
excelserver=create oleobject
excelok=excelserver.connecttonewobject("excel.application")
//检查返回值,以确保已成功地连接到了Excel
if excelok <> 0 then
messagebox("信息提示","连接EXCEL失败,请检查计算机中是否安装了EXCEL!")
return -1
end if
li_net = GetFileOpenName("选择文件", str_savename,named,"xls","Excel文件(*.xls),*.xls")
if li_net > 0 then
if str_savename = "" then return -1
dw_1.settransobject(sqlca)
dw_1.reset()
excelserver.workbooks.open(str_savename)
excelserver.activesheet.cells.copy
li_count = dw_1.importclipboard(5) //导入数据,从excel第五行开始导入
clipboard("")
excelserver.quit()
excelserver.disconnectobject()
destroy excelserver
return 1
else
messagebox('信息提示','没有指定导入文件!')
return -1
end if