使用VB.net从多个Excel工作表生成PDf [英] Generating PDf from Multiple Excel sheet using VB.net
本文介绍了使用VB.net从多个Excel工作表生成PDf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CAn任何一个请给我解决方案
使用VB.net从多个Excel工作表生成PDf
我在代码下面使用它不起作用:
CAn any one please provide me the solution for
Generating PDf from Multiple Excel sheet using VB.net
I am using below code nut it is not working:
Dim fileName As String = AppDomain.CurrentDomain.BaseDirectory & "WeeklyReport"
Dim xlsApp = New Microsoft.Office.Interop.Excel.Application
xlsApp.ScreenUpdating = False
Dim xlsBook As Microsoft.Office.Interop.Excel.Workbook
Dim paramOpenAfterPublish As Boolean = False
Dim paramIncludeDocProps As Boolean = True
Dim paramIgnorePrintAreas As Boolean = True
Dim paramFromPage As Object = Type.Missing
Dim paramToPage As Object = Type.Missing
xlsBook = xlsApp.Workbooks.Open(fileName & ".xls", UpdateLinks:=False, ReadOnly:=False)
xlsBook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, fileName & ".pdf", Microsoft.Office.Interop.Excel.XlFixedFormatQuality.xlQualityStandard, paramIncludeDocProps, paramIgnorePrintAreas, paramFromPage, paramToPage, paramOpenAfterPublish)
' xlsBook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, fileName & ".pdf", Microsoft.Office.Interop.Excel.XlFixedFormatQuality.xlQualityStandard, Type.Missing, False, Type.Missing, Type.Missing, False, Type.Missing)
xlsBook.Close(SaveChanges:=False)
xlsApp.Quit()
推荐答案
获得解决方案..需要为office 2007安装saveAspdf ..
Got the solution ..need to install saveAspdf for office 2007..
这篇关于使用VB.net从多个Excel工作表生成PDf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文