您的位置:首页 > 产品设计 > UI/UE

PowerBuilder数据窗口保存为Excel表

2006-02-09 07:24 489 查看
数据窗口保存为EXCEL的好办法
_________________________________________________________________________________
能保存几乎所有内容
// ... Init docname
// ... GetFileOpenName or any other method

if dw_export.SaveAs(docname, HTMLTable!, True) = -1 then
MessageBox("警告!", "无法输出数据.文件写入错误!",Exclamation!)
return
end if


// Convert HTML file to Excel native format
OLEObject excel
excel = CREATE OLEObject
if excel.ConnectToObject(docname) = 0 then
excel.application.DisplayAlerts = FALSE
excel.application.workbooks(1).Parent.Windows(excel.application.workbooks(1).Name).Visible = True
excel.application.workbooks(1).saveas(docname, 39)
excel.application.workbooks(1).close()
end if

DESTROY excel
// done
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: