以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  导出excel后打开Excel文件,提示错误,求解!  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=132927)

--  作者:李孝春
--  发布时间:2019/4/2 14:11:00
--  导出excel后打开Excel文件,提示错误,求解!
代码如下:
Dim dlg As New SaveFileDialog \'定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xls" \'设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮
    Dim ex As New Exporter
    ex.SourceTableName = "干警信息" \'指定导出表
    ex.filepath = dlg.FileName  \'指定目标文件
    ex.Export() \'开始导出
End If
导出的文件打开提示如下:

图片点击可在新窗口打开查看此主题相关图片如下:11111.png
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2019/4/2 14:39:00
--  
Dim dlg As New SaveFileDialog \'定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xls" \'设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮
    Dim ex As New Exporter
    ex.SourceTableName = "干警信息" \'指定导出表
    ex.filepath = dlg.FileName  \'指定目标文件
    ex.Format = "excel"
    ex.Export() \'开始导出
End If