关于PB的一段代码问题!

lianglyw 2008-03-17 10:43:28
各位高手,本人有以下一段代码有不明的地方
long numcols , numrows , c, r
OLEObject xlapp , xlsub
int ret
string ls_pathfile,ls_file
integer li_retval
string ls_colname

li_retval = getfilesavename("select file",ls_pathfile,ls_file, &
"xls","Excel Files (*.xls),*.xls")
if li_retval = 1 then

dw_print.saveas(ls_pathfile,excel5!,true)

numcols = long(dw_print.Object.DataWindow.Column.Count)
numrows = dw_print.RowCount()

xlApp = Create OLEObject

ret = xlApp.ConnectToNewObject( "Excel.Sheet" )
if ret < 0 then
MessageBox("Connect to Excel Failed !",'不能找到Excel!')
return
end if

xlApp.Application.Workbooks.Open(ls_pathfile) //,false,true
xlApp.Application.Visible = true

xlsub = xlapp.Application.ActiveWorkbook.Worksheets[1]


有谁能帮我解释一下以下三句的意思啊?
xlApp.Application.Workbooks.Open(ls_pathfile) //,false,true
xlApp.Application.Visible = true

xlsub = xlapp.Application.ActiveWorkbook.Worksheets[1]
谢谢各位!
...全文
81 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ybkenan 2008-03-19
  • 打赏
  • 举报
回复
樓上搶先了
回帖是一种美德!传说每天回帖即可获得 10 分可用分!
青锋-SS 2008-03-17
  • 打赏
  • 举报
回复

xlApp.Application.Workbooks.Open(ls_pathfile) //,false,true,打开指定的excel文件
xlApp.Application.Visible = true //设置为可见
xlsub = xlapp.Application.ActiveWorkbook.Worksheets[1] //指向第一个表单

743

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 脚本语言
社区管理员
  • 脚本语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧