I'm having issues with my VBA code, it was working fine on my old laptop but I was recently issued a new one. I reinstalled adobe acrobat pro DC and set up my access database the same as before yet when I tried to run one of my modules I got this error:
Code:
Run-time error '-2147319765 (8002802b)':
Automation error
Element not found.
The error occurs on this line: Set Fields = AcroForm.Fields
Code:
Sub populate_pdf(doc_num, template_form_directory, output_directory, array_pdf_field, array_pdf_value)
Dim AcrobatApplication As Acrobat.CAcroApp
Dim AVDoc As Acrobat.CAcroAVDoc
Dim PDDoc As Acrobat.CAcroPDDoc
Dim counter As Long
Set AcrobatApplication = CreateObject("AcroExch.App")
Set AVDoc = CreateObject("AcroExch.AVDoc")
pdf_bool = AVDoc.Open(template_form_directory, "")
If pdf_bool Then
Debug.Print "Populating: " & doc_num
Set AcroForm = CreateObject("AFormAut.App")
Set Fields = AcroForm.Fields 'ERROR TRIGGERS ON THIS LINE!
Does anyone have any idea how to resolve this issue? I'm pulling my hair out over here.
P.S.: The program is meant to populate a large amount of pdf forms using a template form and information from the access database tables.