Skip to main content
Participant
July 12, 2018
Question

Excel VBA code works with Acrobat XI but NOT 2017

  • July 12, 2018
  • 0 replies
  • 981 views

Hi,

I have some Excel 2010 VBA code that’s been working quite well with Acrobat XI Pro.

But when I run it on a PC with Acrobat 2017 Pro, the same code crashes, right at the first step, creating the App.

Rather then post the entire spreadsheet here, this excerpt illustrates the problem. The code runs in Workbook_Open()

'-----

Option Explicit

Private Sub Workbook_Open()

    Dim OkCan As Integer

    Dim AcroApp As Acrobat.CAcroApp

    OkCan = MsgBox("About to run Set AcroApp = CreateObject(""AcroExch.App"")", vbOKCancel)

    If OkCan = vbCancel Then Exit Sub

    Set AcroApp = CreateObject("AcroExch.App")

    MsgBox ("Done")

    Set AcroApp = Nothing

End Sub

'-----

XI Pro, this works.

2017 Pro, crashes on

     Set AcroApp = CreateObject("AcroExch.App")

Run-time error '-2147467259 (80004005)'

Automation error

Unspecified error

References are set correctly, both PC's.

Excel 2010 on both PC's.

Any ideas?

Thanks in advance.