以文本方式查看主题

-  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=78082)

--  作者:XuanYuan
--  发布时间:2015/12/1 19:51:00
--  为什么我用excel报表添加了保存语句后还会提示保存
 

Dim Book As New XLS.Book(ProjectPath & "Attachments\\东飘总装MO票(集团版).xlsx")

Dim fl As String = ProjectPath & "Reports\\东飘总装MO票(集团版).xlsx"

Book.Build()

Book.Save(fl)

Dim App As New MSExcel.Application

Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)

Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)

Ws.PrintOut

App.Quit

 

我已经有

Book.Save(fl)、老是打印完后还是提示要保存excel.

后边加了 

Dim Proc As New Process

Proc.File = fl

Proc.Start()还是不行


--  作者:大红袍
--  发布时间:2015/12/1 19:54:00
--  

Dim Book As New XLS.Book(ProjectPath & "Attachments\\东飘总装MO票(集团版).xlsx")

Dim fl As String = ProjectPath & "Reports\\东飘总装MO票(集团版).xlsx"

Book.Build()

Book.Save(fl)

Dim App As New MSExcel.Application

Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)

Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)

 

Wb.Saved = True
App.DisplayAlerts = False \'加上此行可禁止弹出合并前的提示

 

Ws.PrintOut

App.Quit