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

This discussion was created from comments split from: Run time error 5, invalid procedure call or argument.
«1
  • I have the same issue. I believe it started when Zotero was updated through auto-update. I haven't been able to find a solution yet.
  • @kobatan did you find a solution?
  • Zotero 5.0.96 fixed one major cause of this — it shouldn't have caused it.

    @arshiasobhan: What's the full error that you're getting? There should be a debug button that lets you open the Visual Basic console, which should show you the line where the error is occurring. Can you paste that in?
  • @dstillman thank you for the reply.

    The full error is: Run-time error '5': Invalid procedure call or argument.

    The Debug button is there, but it is disabled.
  • What macOS version and exact Word version? And can you provide a Report ID from Zotero?
  • I'm using:
    macOS Catalina 10.15.7
    Word 16.46 (21021202)

    Report ID: 1099239982
  • OK, @adomasven will need to look into this. I'm not sure why the debug button is grayed out, but I suspect we'll need to figure out how to get that enabled for you — something related to VBA in Word — in order to troubleshoot this further.
  • Thanks, I really appreciate it.
  • Download this file https://www.dropbox.com/s/39ml5j0bx61cyy7/Zotero.scpt?dl=0 and put it on your Desktop. Make sure Zotero and Word are open. Then open the Terminal.app and run the command bellow:
    cd ~/Desktop && osascript Zotero.scpt "PIPE=\"$HOME/.zoteroIntegrationPipe\"; if [ ! -e \"$PIPE\" ]; then PIPE=\"$HOME/Library/Containers/com.microsoft.Word/Data/.zoteroIntegrationPipe\"; fi; if [ -e \"\$PIPE\" ]; then echo 'MacWord16 addEditCitation /Applications/Microsoft Word.app/' > \"\$PIPE\"; else exit 1; fi;"
    You should see Zotero initiate the citing operation on your open Word document if it is successful.
  • Hi I am getting the exact same error including debug being grayed out and it is ruining my life.

    I just reported the error through zotero. Report ID: 440810759.

    I'm running:
    MacOS Big Sur v11.2.1
    Microsoft Word for Mac 16.46

    I downloaded the file and ran the above command from the terminal. The citing operation window opened and it worked for adding one citation. I am in the same document and went to add another citation and it didn't work. I can't run that code for every citation.

    Also, as you'll see in the error report I am currently working with the Big Sur beta as I thought maybe that was the problem. I had the same error from both the newest version of Zotero and when reverting to the beta.

    Rebecca

  • edited March 2, 2021
    @stubbsrl If you download this old Zotero.dotm file, place it in the Word startup folder, which should be ~/Library/Group Containers/UBF8T346G9.Office/User Content/Startup/Word and restart Word, does the plugin work?
  • Yes that worked! Thanks!!!
  • OK, thanks. We've released Zotero 5.0.96.1, which fixes this problem. (It won't make a difference for you now, since it just switches back to that older template file.)
  • Same error as @stubbsrl.

    Cannot insert citations. Both the keyboard shortcut and Ribbon item cause a Visual Basic error. The error dialog is hidden (visible only with Mission Control) and cannot be interacted with. It also makes Word impossible to interact with, so I have to force quit every time.

    It says:

    実行時エラー 5: プロシージャの呼び出しまたは引数が無効です。
    (Runtime error 5: Invalid procedure call or argument.)

    I replaced the Zotero.dotm with the one @adomasven linked to above, with no effect.

    The script, however, works fine. I can even use it when I can't click on Word. I successfully inserted a citation with the script, but I can't edit the document further, nor can I save it, etc. The Visual Basic error dialog still interferes with all attempts to do anything in Word.

    Running:
    MacOS 11.6 (20G165)
    Word 16.53 (21091200)
    Zotero 5.0.96.3
  • Does it work if you change your computer locale to English temporarily?
  • @adomasven, do you mean changing the system language?
  • Changing my system to English does seem to have alleviated the problem. Thank you!

    However, having the system in English is not ideal. Is there another workaround?
  • I'm afraid not. We are not able to reproduce this issue on our systems if we switch language to Chinese and we have Chinese users that are using Zotero with Mac Word fine, so it's a system specific issue.
  • Thank you for following up.

    For reference, I've been using Zotero in MacOS set to Japanese since at least 2010, and this is the first time this error has occurred.

    I suppose there's no way to know what "system-specific" issues are causing this problem? In which case, I suppose the best thing is just to wait for an update and see what happens?
  • For reference, I've been using Zotero in MacOS set to Japanese since at least 2010, and this is the first time this error has occurred.
    Sorry, I didn't realize this was Japanese. We've only ever had reports about this from Chinese users.
    I suppose there's no way to know what "system-specific" issues are causing this problem?
    If I were to make an educated guess I'd say it has something to do with the naming of localized word data folder paths and the way those are handled on macOS. I imagine this affects things other than just the Zotero plugin on macOS with non-English locales, so it's likely that an update for Word would fix this.
  • Thanks again, @adomasven .

    I'll try to roll back the latest Word update and see if that helps.

    If it doesn't, later, when I have some time, I could test what happens if I switch to some other languages I'm comfortable in (French, Norwegian, maybe Spanish or Italian). But that probably wouldn't help because they're all romanized.
  • If you're comfortable answering, which country was this Mac bought in and which country are you in now? I had a hypothesis that it could potentially be caused by hardware sold in China or software updates to Chinese users, but that might not be the case.
  • edited October 6, 2021
    Brand new MacBook Pro bought through my uni here in Norway just two months ago.

    However, I cannot reproduce the error on a MacBook Air purchased in Japan (and with macOS in Japanese) but with Zotero not fully updated.
    MacOS 11.6 (20G165)
    Word 16.53 (21091200)
    Zotero 5.0.96.2 ← not 3

    Occam and his razor are pointing emphatically to the the latest release of Zotero, though as you say, it could be a hardware issue or something else.
  • If you upgrade to 5.0.96.3 on this MacBook Air does it break? Similarly, does the new MBP break if you revert to 5.0.96.2?

    Also, I'm not sure if rolling back just the last Word update will help as this is quite an old issue by now. Did citing with Zotero ever work with Japanese language on the MBP?
  • Rollback of Zotero to 5.0.96.2 worked. Back to citing as usual.
    Thanks for the link; saved me the trouble of rooting around for it, which is much appreciated!
  • Huh. That's a surprise, since we pushed no changes for the Word plugin between the two versions. Could you upgrade Zotero on the MacBook Air when you have a chance and confirm that breaks it?
  • edited November 3, 2021
    Update:

    Sorry for the delay. The trackpad on the (Japan-bought) Air died and I couldn't use it for a while. Now that that is fixed, I updated it to 5.0.96.3. Works as advertised.

    5.0.96.3 still doesn't work on the (Norway-bought) Pro. I updated and tried it based on success with the Air, and have now had to downgrade.

    Should I switch to the Beta channel? Are there any risks to the integrity of the database in doing so?
  • EDIT/ADDITION
    So, now 5.0.96.2 doesn't work either (MacBook Pro). I'll try to downgrade Word and see if that helps, but it looks like that's a pretty heavy lift (at least on a Mac). Any advice would be appreciated.

    For reference, Word is currently 16.54 (21101001), so it's also been upgraded since my original post.
  • edited November 3, 2021
    Updating to the Beta is not risky for your database, although you won't be able to revert to the stable version unless you make a backup or resync via Zotero sync. It is also unlikely to address the issue in a permanent fashion. Does changing the language to English still work? Does it immediately break if you revert back to Japanese? What versions of macOS are both these machines running?
Sign In or Register to comment.