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)