Hi All,
I have a file which prints specific tabs to PDF on the click of a button. I am trying to find a way to combine this with an external PDF which already exists. I saw a post from several years ago with the same question but there were no answers.
My file currently prints a two page PDF page and ideally I would like the external PDF file inserted between these two pages. Does anyone know if this is possible?
Below is the VBA used to generate the PDF. The file will PDF
I have a file which prints specific tabs to PDF on the click of a button. I am trying to find a way to combine this with an external PDF which already exists. I saw a post from several years ago with the same question but there were no answers.
My file currently prints a two page PDF page and ideally I would like the external PDF file inserted between these two pages. Does anyone know if this is possible?
Below is the VBA used to generate the PDF. The file will PDF
VBA Code:
Sub PDFall()
Dim Answer As Variant
Answer = MsgBox("Existing PDF file will be overwritten.", vbOKCancel)
If Answer = vbOK Then
Dim CWB As String
CWB = ActiveWorkbook.FullName
Dim CWBName As String
CWBName = ActiveWorkbook.Name
Dim PDFName As String
PDFName = "IMI CCI Proposal " & Sheets("Input Page").Range("E8").Value & "_" & _
Sheets("Input Page").Range("E4").Value & "_" & Sheets("Input Page").Range("F8").Value & _
".pdf"
Dim PDFPath As String
PDFPath = Replace(CWB, CWBName, "")
Dim PDFfullpath As String
PDFfullpath = PDFPath & PDFName
'--------------- Hide & PDF & Unhide --------------------------------------------
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Range("A1").Value = "0" Then 'Skip sheets with "0" in cell A1
ws.Visible = xlSheetHidden
End If
Next
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
PDFfullpath, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
For Each ws In ActiveWorkbook.Worksheets
If ws.Range("A1").Value = "0" Then
ws.Visible = xlSheetVisible
End If
Next
Sheets("Input Page").Select
End If
End Sub