Fix/workaround: PDFMaker “Run-time error 5” in Word for Mac when a filename contains a comma
I found and fixed one reproducible cause of the following error in Microsoft Word for Mac:
Run-time error ‘5’:Invalid procedure call or argument
This occurs when using the commands on Word’s Acrobat tab—including Create PDF—to convert the open Word document into an Adobe PDF.
In my case, the error occurred whenever the Word document’s filename contained a comma. For example:
Dewey, Cheatham & Howe.docx
Removing the comma allowed the same document to convert normally. I have not tested a comma in the name of an enclosing folder, but the same failure appears likely because the complete file path is passed to Acrobat.
The cause
Acrobat’s PDFMaker integration installs a small AppleScript helper named AcrobatUtils.scpt. Word passes the document path and several internal control values to this helper as a single comma-separated string.
The helper splits that string at every comma and assumes that the first part is the complete file path. Consequently, a perfectly valid comma in a filename is incorrectly treated as a separator. This truncates the path and shifts the remaining arguments, eventually producing VBA Run-time error 5.
The workaround
I have published an open-source patcher here:
https://github.com/jbrest/pdfmaker-mac-comma-fix
The patcher applies a narrowly scoped source-level change—the equivalent of a small diff—to the copy of AcrobatUtils.scpt already installed on the user’s Mac. It first checks that the installed helper contains the known affected code, creates a timestamped backup, applies the change, recompiles and validates the AppleScript, and provides a rollback command.
The repository does not contain or redistribute Adobe’s AcrobatUtils.scpt, its locked VBA project, or a modified copy of either file. It contains my independently written patcher, tests, and documentation. The modification is performed locally against the user’s own installed copy.
Scope
The workaround has been tested with:
• Adobe Acrobat Pro 26.002.21901
• Microsoft Word 16.113.2
• macOS 26.6.2
Tests cover filenames containing one comma, multiple commas, and the optional additional parameter used by Adobe’s helper.
The patcher deliberately refuses to modify an AppleScript version that it does not recognize. An Acrobat update may replace the patched helper, in which case its status should be checked again.
Possibly related reports
The same Run-time error 5 was previously reported in connection with Word:
A similar error was reported in connection with Excel:
https://community.adobe.com/questions-9/runtime-error-5-1257541
Run-time error 5 is a generic VBA error, so I cannot determine whether either earlier report had the same underlying cause. This workaround may help the Word case if the error disappears when commas are removed from the filename or folder path.
The published patch specifically targets PDFMaker’s Word helper and should not be represented as a fix for the Excel case.
This is an unofficial workaround and is not affiliated with or endorsed by Adobe. The preferable permanent solution would be for Adobe to stop passing file paths as unescaped comma-separated text.
Credit
The technical investigation, patch development, and automated testing were carried out with assistance from OpenAI Codex. I reproduced the issue and verified the resulting fix on the configuration listed above.
