Microsoft Word (for Mac) sudden conflict with Word Processor Add-In [Run Time Error: ‘5’]

Report ID: 230829537
OS: Mac (Catalina and Big Sur)

I have been using Zotero for about 10 years since I worked at CHNM. Until recently, the Microsoft Word Processor Add-In has worked well, allowing me to easily add endnote/footnotes and bibliographies through the Zotero menu in the Word ribbon pane.

When trying to teach my students this feature in Word (both last week and today), I receive a pop-up message: Run Time Error: ‘5’ Invalid Procedure Call or Argument. I tried uninstalling Zotero and then re-installing it - no luck. I updated Word, closed it out, rebooted my Macbook - no luck. Ran a Debug (Debug ID: D264744190) - no luck.

This problem is recent; no problem up until Nov or Dec of 2020. I am having this same Run Time Error: 5 problem on my Macbook Pro running Catalina, and my Mac Mini running Big Sur. Just to be sure, I checked with my university's IT director and our Zotero librarians, and their Word Processor Add-In is working just fine on both PCs and Macs.

Any help is appreciated.
  • edited January 26, 2021
    FWIW - when I click on "Help" on the Run Time Error: '5' pop-up, it directs me to this page on the Microsoft website:;k(TargetFrameworkMoniker-Office.Version%3Dv16)%26rd%3Dtrue

    Screen Snips:
  • What exact version of Word?
  • Microsoft Word for Mac Version 16.45
  • This error generally indicates that Word is having problems running AppleScript. This might be a system-wide issue on your machines or some new restriction on Word. It is likely to be caused by security software, Word extensions or some other software you may have installed recently.
  • Our IT director and I have worked on any and all software issues at our university, but no luck. Zotero is working fine, and the Zotero Connector as well. The problem is the Word Processor, and the problem only surfaced recently. I even downgraded to Word 16.43 (which some on the forum says helped resolve similar-type issues), installed Zotero Beta, reinstalled the Word Processor Add on ... nothing. Other university employees (our Zotero librarians) also use Macs and Word for Mac, and their Word Processor Add-On works just fine for adding and editing citations.
  • You should see this thread where we did some extensive troubleshooting of the issue with one of our users. If you need help with the technicalities I'm sure your university IT will be able to assist. This is an error that we unfortunately simply don't have a general cure or even a good way to troubleshoot, but it happens because Word is unable to run AppleScript from a Visual Basic macro.
  • Thanks for your help and patience. I read this thread, and I followed each step. Same Run Time Error 5 pop up. I also deleted Zotero.dotm from its home folder, and then manually reinstalled it following each step.

    I also followed the macros debug steps in Zotero.dotm outlined in the thread, replacing the error line: "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" " with "MacScript "display dialog ""test"" " The dialog says "test"

    I know there is not much you can do at this point. I had this problem before and after updating to Big Sur, but everything worked fine the last time I used Zotero for adding citations in Word (back in late summer 2020). If this were a university IT issue that is fine, but our Zotero librarians (one of whom is on a Mac) have no problems whatsoever. So I doubt it's a university software security problem. And if the problem were on just one of my university devices, that would make sense because I l=could look at a possible conflict with an extension or other download ... but both my desktop and laptop suddenly developed this problem and I keep my desktop minimal with apps and extensions.
  • Before replacing that line, did you try running the Macros manually? Which line did the macro fail on?
  • this one - currentPath = MacScript("tell application ""Finder"" " & nl$ & "POSIX path of (path to current application)" & nl$ & "end tell")••••ˇˇˇˇ¿∞¯? - but it no longer appears.
  • Have you by any chance moved Microsoft from /Applications to some subdirectory? Perhaps with latin characters with diacritics?
  • No, it's been in the applications folder. It's not in a subdirectory. Originally I have been updating every release (our university asks us to), but when I read on the forums that some people with similar issues had better luck reverting to 16.43 or earlier, I deleted Word, rebooted, then installed an earlier version of Word for Mac. Right now I am using 16.34 because that was a version I know for a fact was on my laptop when I last successfully used Zotero / Microsoft Word Add-in for editing a paper. But still no luck.
  • edited February 2, 2021
    What did you mean in your previous comment with "it no longer appears". If you restore the original Zotero.dotm file, what line does running the Zotero macro from Visual Basic editor fail on?

    Oh, no need to do that. If you restore the Zotero.dotm file and you still see the Run Time Error 5 it means there is a problem running that AppleScript line from Visual Basic. Because it started happening on both of your computers it is highly likely that some change since the last time you worked with Zotero on both of your machines that you would have performed yourself (like software install) would be the cause. Unfortunately in the past the most success other users had in fixing this bug was by reinstalling macOS completely.
  • @rwany_sibaja: Some additional comments here were split off, so just pinging you again to make sure you see the response.
  • Update: Our IT department did a wipe and clean install on my MBP. I then reinstalled Microsoft Office, but this time through the Office 365 webpage using our university credentials. Same Run Time Error 5. [I installed Office 365 on my personal Macbook Air at home, also using my univ. credentials, and I have no problems with Zotero and Word working together]. Trying to see if other Mac users with Zotero installed are having the same problem on their univ.-issued devices.
  • FWIW, I am also having this problem. I also have a university issued device, though I mostly maintain it myself. I've not had a chance to try to debug the problem... running Word. 16.45 and just upgraded to Big Sur (in the hopes that would fix the problem). I'll update this thread when I have a chance to dig into the problem a little further.
  • This might shed some insight:

    I'm going to try extracting the embedded applescript into a distinct file and then calling that with the updated "AppleScriptTask".
  • @jintrone Good find. I'll look into amending the Zotero Word template so we will fix this for all.
  • Thanks, I'll be curious to know what progress you make. This is still urgent for me, so I'm continuing the effort. Unfortunately, calling AppleScriptTask still results in the same error. I remain uncertain why, but will post further updates if I learn anything new.
  • edited February 16, 2021
    Ok, we will have a change for this available to test with the Zotero Beta within the next 24 hours. If you want to try it out before then you can download Zotero.dotm and Zotero.scpt from our Github repo. You need to place the Zotero.dotm file according to manual plugin installation instructions and place the Zotero.scpt file into
    ~/Library/Application Scripts/
  • Oh that's super exciting! You guys rock. Thanks for getting on this! I'll give it a try.
  • The change is now available in the Zotero Beta. Let us know if it works for you.
  • Works like a charm! Thank you so very much, you've just saved me a whole bunch of time - I'm very grateful.
  • Zotero 5.0.96 is out now with this fix, so if you switched to the beta for this, you can redownload Zotero from the download page and it should work.
  • @rwany_sibaja, @jintrone: We've unfortunately had to revert this change in due to its causing other, more serious problems (including other instances of this error). You can stay on 5.0.96 for now or, if you do update to, download the Zotero.dotm file that fixed this for you and follow the manual installation instructions to put it in your Word startup folder.

    We'll try to come up with a fix that works for everyone.
  • Ok, thanks for the heads up.
  • edited March 8, 2021
    I'm having the same problem I believe. I just downloaded Zotero for the first time. I'm running Zotero on a Mac with Catalina and Word 16.46.

    I'm able to see the Zotero toolbar, and Zotero tells me the plugin in installed in Word. When I click to Add/Edit citation using the word toolbar, it says there is a runtime error 5.

    I had been using the Mendeley plugin, and it was working until I downloaded Zotero. Now both plugins are giving me the same Runtime error. I've deleted everything Mendeley to try to fix the issue on the Zotero end.

    Any help? Any way to tell if my problem is caused by something different?
  • I'm also having this problem. I've been running Zotero for a while. Currently have Zotero on a Mac with Catalina (recently upgraded) and Word 16.46. I initially tried uninstalling and then reinstalling, but no luck.

    Like the user above, the Zotero toolbar shows up, but every time I execute it I get a runtime error 5.

    Our IT folks have done all they can to help, but even using the Zotero.dotm file above did not fix the problem.

    Also seeking help - I'd really love to keep using Zotero.
  • @bkjakubiak @christakelleher @wagszoo Do you still see this problem? Did you try updating to Word 16.47 and is it still present there?
  • I have the same problem. When I try to Add/Edit citation or bibliography, I get the Run-time error '5'. Using the Zotero Beta worked until yesterday, but now the problem is back. I just updated to Word 16.47 and I still see the problem. Thanks in advance for your help.
Sign In or Register to comment.