Wednesday, 20 September 2017

excel - Exporting multiple pages to PDF in a specific order

I am trying to export pages from two different sheets of a workbook as 1 PDF.



However, I want the pages to be in this order: 1 page from Sheet1, 5 pages from Sheet2, 2 pages from Sheet1.



At the moment I am exporting these as 3 seperate PDFs and then merging them afterwards in another application.



The code I have been using is below:



ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=sPath & quotept1filename, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=1, To:=1, OpenAfterPublish:=False


ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=sPath & quotept2filename, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=2, To:=3, OpenAfterPublish:=False

Sheets("PPA Print Ready Quote").Select

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=sPath & optionsfilename, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=1, To:=NumberOfOptions, OpenAfterPublish:=False


How can I get them to print as one PDF in the order I want?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...