Excel设置打印区域不影响导出为PDF布局

时间:2019-09-06 15:01:16

标签: excel vb.net printing

ExportAsFixedFormat没有遵循pagesetup打印区域,我尝试将忽略打印区域导出为true和false,这是行不通的。

Dim xlApp As New Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet

xlWorkBook = xlApp.Workbooks.Open(PastaLocal & "\Modelo Pedido.xlsx")
xlApp.Visible = True
xlWorkSheet = xlWorkBook.Sheets("Sheet1")

' Setting print area and exporint as PDF
xlWorkSheet.PageSetup.PrintArea = "A1:U55"
xlWorkSheet.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, PastaLocal & "\PedidoTal.pdf", False, True, False)

0 个答案:

没有答案