logo
search
VBA & Macro Problems

How to Bulk Convert Word Files Using Mac VBA Macros

Jason MillerJason Miller Oct 15, 2026 870 views

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.

How to Bulk Convert Word Files Using Mac VBA Macros
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.
Before you start

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.

Solution 1Recommended

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.

1
Format your file paths correctly

In your VBA editor, ensure all file paths use forward slashes (/) instead of backslashes (\). For example, use a path like '/Users/username/Desktop/Test/'.

2
Run the ODT conversion macro

Execute your first macro that loops through the folder, opens the source DOCX files, saves them in the ODT format, and closes them.

3
Relocate the original files

Move the original DOCX files out of the target folder so they do not interfere with the second step.

4
Run the DOCX conversion macro

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.

Use Sequential Macros with Correct Mac File Paths
Dir Function Compatibility: The VBA Dir function works properly in newer versions like Microsoft 365 and Office 2019 for Mac. If you are using an older version of Mac Word VBA, the Dir function may fail to loop through the folder.
Free Microsoft Office alternative

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. 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. 2. Open Your Documents Directly: Launch WPS Writer and open your DOCX or ODT files without needing complex macros to fix formatting.
  3. 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.
Native and flawless compatibility with Microsoft DOCX and ODT file formats.Free and lightweight Office suite optimized for Mac users.Familiar user interface requiring zero learning curve for seamless migration.
microsoft office alternative - wps office

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.