以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]Excel报表预览,代码哪里有问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=84701)

--  作者:wusim
--  发布时间:2016/5/8 9:03:00
--  [求助]Excel报表预览,代码哪里有问题
Dim Book As New XLS.Book(ProjectPath & "Attachments\\告知书.xls")
Dim fl As String = ProjectPath & "Reports\\告知书.xls"
Book.Build() \'生成细节区
Book.Save(fl) \'保存工作簿
Dim Proc As New Process \'打开工作簿
Proc.File = fl
Proc.Start()
App.Visible = True
Ws.PrintPreview
App.Quit

--  作者:大红袍
--  发布时间:2016/5/8 10:00:00
--  

Dim Book As New XLS.Book(ProjectPath & "Attachments\\告知书.xls")
Dim fl As String = ProjectPath & "Reports\\告知书.xls"
Book.Build() \'生成细节区
Book.Save(fl) \'保存工作簿

Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("d:\\test.xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
App.Visible = True
Ws.PrintPreview
App.Quit