GetJSObject does not work when working on Microsoft Surface (Excel-VBA)

I wrote a small utility in Excel-VBA that also interacts with Acrobat Javascript in several separate .pdf files.

This code has been tested extensively and works exactly the same as on my desktop PC. Ultimately, however, I need to implement this code on the Microsoft Surface platform. When I try to run the same code from an Excel file on Microsoft Surface, the code intercepts any rows using "GetJSObject".

Eg. It works fine on my PC, but the error "object or method is not supported" occurs on my surface.

Set gAPP = CreateObject("AcroExch.App") Set gPDDOC = CreateObject("AcroExch.PDDoc") If gPDDoc.Open(pdfFileName) Then Set jso = gPDDOC.GetJSObject 

Until now, I could find hints on the Internet that GetJSObject does not work well in a 64-bit environment, and my Surface works with 64-bit Windows 10 and 32-bit Excel.

However, I do not think that this in itself can explain the difference in behavior on both machines; my desktop works with 64-bit Windows 7 with 32-bit Excel, and everything works as intended.

Where should I look to find the source (and solution) of the problem?

EDIT / UPDATE : The getJSObject statement really works as intended if I take the extra step manually by opening a copy of one of the corresponding .pdf files in Acrobat before running my VBA code. I suppose this means that somehow the definitions of objects (for example, Set gAPP = CreateObject("AcroExch.App") ) work differently on the surface compared to my PC - not the getJSObject command, as it originally was it supposed?

Until now, it did not make much sense to me how / why this might be true (not to mention how I could solve the problem).

+6
source share
1 answer

I’m not sure that the answer was given, but there are two areas of action that I would take to study:

1.

See if you can run it without a constructor using:

 Set AcroApp = New AcroApp 

Instead

 Set AcroApp = CreateObject("AcroExch.App") 

2.

Make sure you use the same version of acrobat, from my research this error occurs from the very first result in Google for a search query:

 createobject acroexch.app error 429 You cannot do this with Adobe Reader, you need Adobe Acrobat. 

This OLE interface is available in Adobe Acrobat, not in Adobe Reader.

+1
source

All Articles