Skip to main content
markr46371735
Participant
March 9, 2016
Answered

Is it possible to have Acrobat Javascript send a message to Excel VBA?

  • March 9, 2016
  • 2 replies
  • 4864 views

In short, what I am trying to do is to is to code a button in an Acrobat file that, when pressed, will run some Javascript within Acrobat -- say, app.alert("You have pressed me!"); and also somehow will call a routine in an Excel VBA file -- say msgbox "That's right, you pressed that button in Acrobat!"


Obviously it's trivial to do the first part. But the second part seems like it should be easy, but that it might be impossible.

Is there any way to send a message to VBA whenever a particular event (like a button-press) occurs in Acrobat?

(I can create a somewhat slow and clumsy work-around by setting up a global variable in Acrobat Javascript that updates whenever a button is clicked, and then continuously polling the value of that global variable from Excel using getJSObject. But in my particular project, this is undesirable and I am hoping that perhaps there is a cleaner and more direct way to accomplish the same thing.)

This topic has been closed for replies.
Correct answer Test Screen Name

‌Should hopefully be impossible by any means.

2 replies

Inspiring
March 14, 2016

There may be more elegant ways of doing this, but probably only by using the more extensive developer interfaces of Excel and Acrobat. For example you can produce a new Action handler for Acrobat that can be called from the button and update a cell/variable in Excel. My company is working on an Acrobat plug-in at the moment that can talk directly to Excel so I know that this can be done.

Test Screen NameCorrect answer
Legend
March 9, 2016

‌Should hopefully be impossible by any means.