acrobat 9 trying to use vb to se fields gives error acroexch.app not installed

Community Beginner ,
Feb 20, 2018

Copy link to clipboard

Copied

how do I resolve this I have googled unti numb

Adobe Community Professional
Correct answer by Karl Heinz Kremer | Adobe Community Professional

You need a reference to the correct type library. See here for more information: Where can I get the AFormAutLib.dll?

Then, you need to fix your code, it seems you are mixing up the parameters for Dim and CreateObject:

  1. Dim AFORMAUT As AFORMAUTLib.AFormApp 
  2.     Set AFORMAUT = CreateObject("AFormAut.App")
TOPICS
Acrobat SDK and JavaScript

Views

563

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

acrobat 9 trying to use vb to se fields gives error acroexch.app not installed

Community Beginner ,
Feb 20, 2018

Copy link to clipboard

Copied

how do I resolve this I have googled unti numb

Adobe Community Professional
Correct answer by Karl Heinz Kremer | Adobe Community Professional

You need a reference to the correct type library. See here for more information: Where can I get the AFormAutLib.dll?

Then, you need to fix your code, it seems you are mixing up the parameters for Dim and CreateObject:

  1. Dim AFORMAUT As AFORMAUTLib.AFormApp 
  2.     Set AFORMAUT = CreateObject("AFormAut.App")
TOPICS
Acrobat SDK and JavaScript

Views

564

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 20, 2018 0
Adobe Employee ,
Feb 20, 2018

Copy link to clipboard

Copied

Adobe no longer supports Acrobat 9.

However make sure you that you have Acrobat Professional (or Standard) installed and not just Reader.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 20, 2018 1
Community Beginner ,
Feb 28, 2018

Copy link to clipboard

Copied

I have Acrobat 9 Standard installed

>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 28, 2018 0
Most Valuable Participant ,
Feb 28, 2018

Copy link to clipboard

Copied

Do you also have Acrobat Reader installed (Any version)?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 28, 2018 0
Community Beginner ,
Feb 28, 2018

Copy link to clipboard

Copied

Yes I did have reader but i uninstalled - did not fix the problem

>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 28, 2018 0
Most Valuable Participant ,
Feb 28, 2018

Copy link to clipboard

Copied

Try a REPAIR on Acrobat now. if not enough, try having Acrobat already running when using your code. If that still doesn’t help please tell us your code and error.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 28, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

Here is error msg. with Acrobat running

And complete code attached

Thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Most Valuable Participant ,
Mar 02, 2018

Copy link to clipboard

Copied

Please don’t try to email screen shots, we do not see them. You can come to the forum and post them or type out the text.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

fair enough Acrobat is running and still get this error

pdferror.jpg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

after error I quit program it closes the Acrobat window that was open

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

error is now from different line when Acrobat is open

pdferror3.jpg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

took out bOK now error is at

pdferror4.jpg

And code does open my form and ion screen at this point

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

OK running as admin no errors with code now but but for each formfield loop doesn't see any fields

pdferror5.jpg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

OK did post in forum new at this

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

A zillion googles later I have it working

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Adobe Community Professional ,
Mar 02, 2018

Copy link to clipboard

Copied

To save somebody else some time, can you please share what you found.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 04, 2018

Copy link to clipboard

Copied

first fix activex error - this line fixed that

then to try and figure out I commentd out this line  AcroExchApp.Hide()

so here is complete and working code

' want to add temp table

        Dim nRowCounter As Integer

        'Create the table

        Dim Table1 As DataTable

        Table1 = New DataTable

        'Add columns to it

        Table1.Columns.Add("Id", Type.GetType("System.Int32"))

        Table1.Columns.Add("Name", Type.GetType("System.String"))

        Table1.Columns.Add("Type", Type.GetType("System.String"))

        'Add rows and fill with data

        Dim EditRow As DataRow

       

        Dim AcroExchAVDoc As CAcroAVDoc

        Dim AcroExchApp As CAcroApp

        Dim AFORMAUT As AFORMAUTLib.AFormApp

        Dim FormField As AFORMAUTLib.Field

        Dim FormFields As AFORMAUTLib.Fields

        Dim bOK As Boolean

        Dim sFields As String

        Dim sTypes As String

        Dim sFieldName As String

        Dim mycount As Integer

        ' For this procedure to work, computer must have a full version

        ' of Adobe Acrobat installed. Also, a reference to the following

        ' Type Libraries must be made:

        '     AFormAut 1.0

        '     Adobe Acrobat 7.0 (or newer)

        On Error GoTo ErrorHandler

        AcroExchApp = CreateObject("AcroExch.App")

        AcroExchAVDoc = CreateObject("AcroExch.AVDoc")

        'bOK = AcroExchAVDoc.Open(ActiveWorkbook.Path & "\" & PDF_FILE, "")

        'bOK = AcroExchAVDoc.Open("C:\PCode2017\PDFinfo\testform.pdf", "")

        AcroExchAVDoc.Open("C:\PCode2017\PDFinfo\testformold.pdf", "")

        'I have since found that to get the field lists in Acrobat 9 then

        ' AcroExchAVDOC.BringToFront and AcroExchApp.Hide need to be used.

        ' As without these the Acrobat object thinks there is no form loaded.

        AcroExchAVDoc.BringToFront()

        AcroExchApp.Hide()

        sFields = ""

        sTypes = ""

        bOK = True

        If (bOK) Then

            'AFORMAUT = CreateObject("AFORMAUT.App")

            ' now no activex error

            AFORMAUT = New AFORMAUTLib.AFormApp

            FormFields = AFORMAUT.Fields

            'FormFields = New AFORMAUTLib.Fields

            mycount = FormFields.Count

            For Each FormField In FormFields

                With FormField

                    sFieldName = .Name

                    nRowCounter = nRowCounter + 1

                    EditRow = Table1.NewRow()

                    EditRow(0) = nRowCounter

                    EditRow(1) = .Name

                    EditRow(2) = .Type

                    Table1.Rows.Add(EditRow)

                    If .IsTerminal Then

                        If sFields = "" Then

                            sFields = .Name

                            sTypes = .Type

                        Else

                            sFields = sFields + "," + .Name

                            sTypes = sTypes + "," + .Type

                        End If

                    End If

                End With

            Next FormField

            AcroExchAVDoc.Close(True)

        End If

        'Create a dataset and add this table to it

        Dim DS As DataSet

        DS = New DataSet

        DS.Tables.Add(Table1)

        Me.DataGridView1.DataSource = DS.Tables("table1")

        Debug.Print(sFields)

        Debug.Print(sTypes)

        AcroExchAVDoc = Nothing

        AcroExchApp = Nothing

        AFORMAUT = Nothing

        'Field = Nothing

        Exit Sub

ErrorHandler:

        MsgBox("FieldList Error: " + Str(Err.Number) + " " + Err.Description + " " + Err.Source)

    End Sub

works great - now on to creating code to fill the form

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 04, 2018 1
Adobe Community Professional ,
Mar 02, 2018

Copy link to clipboard

Copied

You need a reference to the correct type library. See here for more information: Where can I get the AFormAutLib.dll?

Then, you need to fix your code, it seems you are mixing up the parameters for Dim and CreateObject:

  1. Dim AFORMAUT As AFORMAUTLib.AFormApp 
  2.     Set AFORMAUT = CreateObject("AFormAut.App")

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0
Community Beginner ,
Mar 02, 2018

Copy link to clipboard

Copied

can't use set -if I typr that in VS2005 it deletes it

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2018 0