Dim Book As New XLS.Book(ProjectPath & "Attachments\坯布.xls")
Dim f1 As String = ProjectPath & "Reports\坯布.pdf"
Dim f2 As String = ProjectPath & "Reports\坯布.xls"
Book.Build()
Book.Save(f2)
Dim App As New MSExcel.Application
try
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(f2)
'创建Excel文件对应的PDF文件
wb.Saved = True
wb.ExportAsFixedFormat(MSExcel.XlFixedFormatType.xlTypePDF, f1, MsExcel.XlFixedFormatQuality.xlQualityStandard, True, True, System.Reflection.Missing.Value, System.Reflection.Missing.Value, False, System.Reflection.Missing.Value)
app.quit
catch ex As exception
msgbox(ex.message)
app.quit
End try
Dim Proc As New Process
Proc.File = f1
Proc.Start()