VBA & Macro Problems

Fix a Word VBA Mail Merge Macro That Stops Running

Huma Ashraf ChHuma Ashraf Ch Nov 13, 2026 869 views

Question details

The user needs a reliable way to create individual PDF mail-merge files from an Excel data source after a Word VBA macro stops running midway.

Fix a Word VBA Mail Merge Macro That Stops Running
Product
Microsoft Word VBA mail merge
Device & OS
not provided
Scenario
The user is running a Word VBA macro that selects a workbook and table to produce individual PDF mail-merge files.
Observed behavior
The macro stops after the workbook and table are selected, and the code contains inconsistent variable names.
Before you start

Open the mail merge main document and confirm it is a Letters-type document. Also check the Excel data source so field names are valid, unique, alphanumeric, and placed in the first row.

Solution 1Recommended

Use the Merge Tools Add-in to Create Individual PDF Mail-Merge Files

Use this when you need a working mail merge without debugging VBA; the add-in creates individual Word or PDF files, names them from data fields, and can send email attachments.

The Merge Tools Add-in handles the record-splitting and PDF export tasks that the failing macro attempted. Download it from the linked OneDrive location and follow the included setup guide.

1
Download and install Merge Tools

Download the Merge Tools Add-in from the linked OneDrive location, open the setup guide, and install it in Microsoft Word.

2
Prepare the Letters main document

Open the mail merge main document in Word and confirm it uses the Letters document type.

3
Check the Excel data source

Make sure Excel field names are in the first row, contain only alphanumeric characters, do not begin with a number, are no longer than 40 characters, and are unique.

4
Run the individual file merge

Select the workbook and table in Merge Tools, choose individual Word or PDF output, and set the file naming field from the data source.

5
Complete the merge

Run the merge and verify that each record produces a separate file, then use the email option if attachments are required.

Use the Merge Tools Add-in to Create Individual PDF Mail-Merge Files
Mail merge completed: Each data row becomes a separate PDF or Word file named from the selected field.
Free Microsoft Office alternative

Use WPS Writer as a Free Alternative for Mail Merge Without VBA Headaches

If the Word VBA macro still stops, WPS Office is a free, lightweight Microsoft Office alternative. It opens your existing Word mail merge templates with familiar tools, preserves .docx and .doc compatibility, and helps you move away from fragile VBA mail merge code.

Avoid fragile Word VBA macros for mail merge and use WPS Writer's built-in document tools instead.Open, edit, and save existing .docx and .doc mail merge templates with Microsoft Office format compatibility.Familiar ribbon interface makes switching from Microsoft Word easy.Free, lightweight download with PDF export for WPS Writer documents.Works with your existing Excel mail merge data sources.
microsoft office alternative - wps office

Frequently Asked Questions

Why does a Word VBA mail merge macro stop after selecting the workbook and table?

It usually stops because the VBA code uses inconsistent variable names for the workbook or table. Open the VBA editor with Alt+F11, compare the Dim statements and assignment lines, rename them consistently, and click Debug > Compile VBA Project before running the macro.

What document type is required for mail merge individual PDF output?

The mail merge main document must be a Letters-type document. Check this in Word before running Merge Tools or a VBA mail merge macro.

What are the Excel field name rules for a mail merge data source?

Excel field names must be in the first row, be unique, contain only alphanumeric characters, not begin with a number, and be no longer than 40 characters.

Can I use the Merge Tools Add-in to name individual PDF files from a data field?

Yes. After selecting the workbook and table, choose individual Word or PDF output in Merge Tools and set the file naming field from the Excel data source.

Does WPS Writer support mail merge documents created in Word?

Yes. WPS Writer can open Word .docx and .doc mail merge templates and provides a familiar Mailings workflow for common merge tasks, but Microsoft Word VBA macros may need to be repaired in Word.