Combining PDFs stopped working

Combining PDFs stopped working

Anonymous
Not applicable
434 Views
1 Reply
Message 1 of 2

Combining PDFs stopped working

Anonymous
Not applicable

I've used this sub for years to combine pdfs into a multisheet pdf.  All of the sudden it stopped working.  It crashes on this line.

 

b = PDDocAll.Open(arrPdfFiles(0))

 

It gives this error.

 

Capture.JPG

 

 

I'm on Windows 8.1 in AutoCAD 2016 using VBA and using Acrobat Pro DC.

 

Below is the complete sub.

 

Any ideas why it's stopped working.

 

David

 

Private Sub CombinePDFs(arrPdfFiles() As String, strFileName As String)


Dim PDFApp As AcroApp

Dim b As Boolean
Dim PDDocAll As CAcroPDDoc
Dim PDDoc As CAcroPDDoc
Dim i As Integer

'On Error Resume Next

Set PDFApp = CreateObject("AcroExch.App")

Set PDDocAll = CreateObject("AcroExch.PDDoc")
Set PDDoc = CreateObject("AcroExch.PDDoc")

b = PDDocAll.Open(arrPdfFiles(0))
b = PDDocAll.Save(1, strFileName)
Kill arrPdfFiles(0)
For i = 1 To UBound(arrPdfFiles)
b = PDDoc.Open(arrPdfFiles(i))
b = PDDocAll.InsertPages(i - 1, PDDoc, 0, 1, False)
b = PDDocAll.Save(1, strFileName)
b = PDDoc.Close
Kill arrPdfFiles(i)
Next

b = PDDocAll.Close
End Sub

0 Likes
435 Views
1 Reply
Reply (1)
Message 2 of 2

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> I'm on Windows 8.1 in AutoCAD 2016 using VBA and using Acrobat Pro DC

Are you running Windows 8.1 32bit or 64bit?

 

And what changed on your system since it worked the last time?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes