VBA to combine multiple .pdf files into one PDF - WITHOUT calling Adobe Acrobat

jagrenet

Board Regular
Joined
Feb 23, 2022
Messages
81
Office Version
  1. 365
  2. 2013
  3. 2011
  4. 2010
Platform
  1. Windows
Hello,

I am trying to find some reference to VBA code that will combine multiple .pdf files into one single pdf ..... in a very specific order. In the Title I specify "without" using Adobe Acrobat because, everything I have found on the subject requires a Reference to the Adobe Library which, I do not want to do. I don't want to call ANY 3rd party software for the simple reason that, .... end users of my program potentially do not have Acrobat, (or any other "required" software) installed on their machines.

I feel like there is a way to do this, I just haven't figured it out yet.
Does anybody have an idea ????

Thanks in advance,
Jeff
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Thanks kweaver but, as stated above ... that is not the route I wish to take.
Yes, I realized that. However, I don't think there's a way to do what you ask using VBA...so I thought I'd mention the EASY way.
 
Upvote 0
Try use this PDFtk - The PDF Toolkit
You can merge the PDF files without using Acrobat.

Sub MergePDF()

Dim command As String
Dim fromPath As String
Dim wbPath As String

wbPath = ThisWorkbook.Path
fromPath = wbPath & "\"
command = "pdftk.exe " & fromPath & "in1.pdf " & fromPath & "in2.pdf " _
& "cat output " & fromPath & "merge.pdf"
Shell command ' Shell "cmd.exe /c " & command

End Sub
 
Upvote 0
Try use this PDFtk - The PDF Toolkit
You can merge the PDF files without using Acrobat.

Sub MergePDF()

Dim command As String
Dim fromPath As String
Dim wbPath As String

wbPath = ThisWorkbook.Path
fromPath = wbPath & "\"
command = "pdftk.exe " & fromPath & "in1.pdf " & fromPath & "in2.pdf " _
& "cat output " & fromPath & "merge.pdf"
Shell command ' Shell "cmd.exe /c " & command

End Sub
Thank you for responding karchunhung. I am looking at you code and I believe I am understanding how it's working. Could you break it down a little, just to clarify please ??
 
Upvote 0
There is nothing special for the code, please refer to PDFtk website for how to use it with Excel.
 
Upvote 0

Forum statistics

Threads
1,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top