为什么用datawindowcontrol.saveas保存为excel文件显示有问题
datawindow为grid的现象是excel文件每一行数据之间都出现一个空行,
如果用tabula格式,excel文件没有grid线
请问该怎么样得到正常的excel
这是我copy别人的代码
// ... Init docname
// ... GetFileOpenName or any other method
if dw_1.SaveAs(docname, HTMLTable!, True) = -1 then
MessageBox("Warning", "Unable to export data. Error writing to file!", 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