MS Word plugin, again..

Report ID: 328961434

Hi there,

Sorry to bring up this topic yet again, but upon trying to use any feature of the MS Word plugin (which does successfully appear in the toolbar) I am presented with:

"Run-time error '5':
Invalid procedure call or argument"

Running Zotero 5.0.93, Word 16.43, on Mac Catalina 10.15.5.

I've tried everything I can think of/find on previous forums:
- Trying a new document
- Reinstalling the plugin both automatically & manually (tried .dot as well as .dotm for good measure — .dot toolbar shows up but returns the same error message)
- Trying a new user account
- Reinstalling Office
- Restarting computer
- Deleting "~/Library/Containers/"
- Checked File Locations: Startup

Hopefully I've just missed an easy fix/made a stupid error..?

  • edited November 30, 2020
    If you're willing to do some advanced troubleshooting:

    1. Open Zotero.dotm directly in Word.
    2. Allow running macros
    3. In the Developer tab click Visual Basic
    4. In the left sidebar select the 2nd Project (Zotero) and open the Zotero code file from the Modules folder
    5. In the top toolbar press the Run Sub/UserForm button (looks like a Play icon) and select "ZoteroAddEditCitation".
    6. You should see the same error, but perhaps there's going to be a bigger trace of the error, more detailed error message, or the editor will highlight the line at which the error occurred.
  • Thanks for the suggestion.

    When I get to step 4, when I select "Project (Zotero)" in VB I get:

    "Project Locked
    Project is unviewable" ?
  • That said, I'm able to run the macros in "Project (Zotero)": each one gives me the same "Run-time error '5': Invalid procedure call or argument" as before.
  • Did you open Zotero.dotm directly with Word (step 1)? Do you have 2 entries for "Project (Zotero)"? Can you expand either? Can you perform the above steps for at least one of them?
  • Ok issue was previously I opened the .dotm file from my Word startup folder; on opening it from Zotero install folder I'm able to run the steps you recommend above (indeed I have 2 entries for "Project (Zotero)" of which one can be expanded).

    Same problem, but this time the 'debug' option is available, taking me to the penultimate line of code which reads:

    "MacScript "try" & nl$ & "do shell script """ & pipeLocation$ & "; if [ -e \""$PIPE\"" ]; then echo '" & wordVersion$ & " " & func & " "" & POSIX path of (path to current application) & ""' > \""$PIPE\""; else exit 1; fi;""" & nl$ & "on error" & nl$ & "display alert ""Word could not communicate with Zotero. Please ensure that Zotero is open and try again."" as critical" & nl$ & "end try""

    Zotero is open, and I've just tried quitting both Word & Zotero and rerunning the same steps.
  • edited November 30, 2020
    You should make a copy of Zotero.dotm somewhere (e.g. your Desktop), open it with Word, then open the Visual Basic editor and replace the line that triggered the error with

    MacScript "display dialog ""test"" "

    Then try running any of the Zotero macros again. You should see a dialog appear that says "test" with a Cancel and OK buttons. Can you confirm this works?
  • edited November 30, 2020
    Ok I've done that but no change: now when I run any macro it returns the same error and the debug option takes me to that line with the newly-entered code. So, no it doesn't work.
  • If you open the Terminal and paste
    osascript -e "display dialog \"test\""

    into it and press Enter do you get a dialog that says "test"?
  • nope! "osascript: can't open default scripting component."
  • Ok, so osascript is the command that runs AppleScript scripts, which is also what Zotero Word plugin uses to interact with Zotero. What causes the error you see is system specific, and while some people do fix it by reinstalling macOS, others, if you google the error, actually have various ideas for troubleshooting it. You'll have to investigate this individually. If you're able to get the above command to run successfully then the Zotero plugin should start working again too. Do share if you manage to figure something out.
  • Ok that makes sense. Thanks for your help.
  • Fwiw I've just updated to Big Sur and everything's working fine now.
  • Hi - I found this thread after searching on the run-time error 5. I've followed all the instructions above, with the same results UNTIL I tested the script in Terminal as suggested. At that point, unlike j_ballance, I did get "test" from the Terminal (even though the script substitution had NOT worked in VB).

    So, what would your advice have been in that case? I really, really want to figure this out, as the alternative at this point is to stop using Zotero and try to recreate my entire library in some other citation manager, which is honestly making me want to cry.

    (Note that I've also updated everything I can think of up to and including the OS, tried reinstalling Zotero, tried reinstalling Word, tried using Zotero in a virgin doc, etc.)
  • Update! I'd literally been googling on this and reading forums off and on over several days, but somehow, once you give up and post a call for help, inevitably the next thing you read fixes things. I found another thread on this problem that suggested installing the Zotero beta; I did; and thank the devs, it worked. Now I want to cry from joy!
Sign In or Register to comment.