Dim Book As New XLS.Book(ProjectPath & "Attachments\订单.xlsx")
Dim f1 As String = ProjectPath & "Reports\订单.xls"
Dim f2 As String = ProjectPath & "Reports\订单.pdf"
Book.Build()
Book.Save(f1)
Dim App As New MSExcel.Application
try
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(f1)
'创建Excel文件对应的PDF文件
wb.Saved = True
wb.ExportAsFixedFormat(MSExcel.XlFixedFormatType.xlTypePDF, f2, 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 = f2
Proc.Start()