How to Bulk Convert Word Files Using Mac VBA Macros
Question details
Automate the process of opening Word files on a Mac, saving them as ODT, and reopening them to save as DOCX to remove conversion-related formatting errors.

- Product
- Word
- Device & OS
- Mac
- Scenario
- Running a VBA macro to bulk process Word documents and fix conversion errors by round-tripping files through the ODT format.
- Observed behavior
- Users encounter issues executing bulk file conversion macros on Mac due to file path syntax differences and VBA Dir function limitations in older Office versions.
Ensure your Word files are placed in an isolated folder, such as on your Desktop, and check that you are running Excel for Mac 2019, Microsoft 365, or a newer version to support the necessary VBA functions.
Use Sequential Macros with Correct Mac File Paths
Run two separate macros in sequence and utilize Mac-specific file path formatting to ensure the bulk conversion works smoothly.
VBA scripts written for Windows often fail on Mac due to file path differences. You must update your paths and split the conversion process into two distinct steps to avoid file access conflicts.
In your VBA editor, ensure all file paths use forward slashes (/) instead of backslashes (\). For example, use a path like '/Users/username/Desktop/Test/'.
Execute your first macro that loops through the folder, opens the source DOCX files, saves them in the ODT format, and closes them.
Move the original DOCX files out of the target folder so they do not interfere with the second step.
Run the second macro to loop through the newly created ODT files, reopen them, and save them back as standard DOCX files to clear any underlying conversion errors.

Try WPS Office for Seamless Word Compatibility on Mac
Avoid complex VBA macros and persistent conversion errors. WPS Office provides a lightweight, highly compatible alternative to Microsoft Word, handling DOCX and ODT formats natively and flawlessly on Mac.
- 1. Download and Install WPS Office: Visit the official WPS Office website to download the free Mac version and install it on your device.
- 2. Open Your Documents Directly: Launch WPS Writer and open your DOCX or ODT files without needing complex macros to fix formatting.
- 3. Save and Export Easily: Edit your documents and securely save them in standard DOCX formats that remain completely compatible with all major office suites.

Frequently Asked Questions
Why does the Dir function fail in my Mac Word VBA?
The Dir function has known compatibility limitations in older versions of Mac Word VBA. It was fixed in Excel for Mac 2019 and Microsoft 365. If you are using an older version, the function may return errors or fail to read folder contents.
How do I format file paths for macros on a Mac?
Unlike Windows, which uses backslashes (\), macOS requires forward slashes (/) for directory paths. Always update your macro to use paths like '/Users/YourName/Desktop/Folder/'.
Why convert Word files to ODT and back to DOCX?
Round-tripping a document through the ODT format strips out complex or corrupted proprietary XML data from a DOCX file, effectively 'cleaning' the document and resolving persistent formatting or conversion-related errors.




