数据窗口保存为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
_________________________________________________________________________________
能保存几乎所有内容
// ... 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