Skip to main content
Inspiring
February 1, 2021
Question

How to late bind Acrobat object in VBA?

  • February 1, 2021
  • 0 replies
  • 572 views

The following code works perfectly in Microsoft excel VBA (Visual Basic For Applications).

Though this Early Binding version works , But if I use it in a workbook, I can not open the excel file on a machine that  Acrobat Pro is not installed.  Excel doesn't find the reference to Acrobat Pro, and all the functions stop working. I need to Late Bind the reference.

 

How can I change it to late binding?

 

Dim AcroPDDocNew    As New Acrobat.AcroPDDoc
Dim AcroPDDocAdd    As New Acrobat.AcroPDDoc
Dim lRet            As Long
    
lPages=0
lRet = AcroPDDocNew.Create()
lRet = AcroPDDocAdd.Open("E:\Test1.pdf")
lRet = AcroPDDocNew.InsertPages(lPages - 1, AcroPDDocAdd, 0, 1, True)

 

Thank you.

 

This topic has been closed for replies.