How to Fix Word VBA Error 5941 for Checkbox Data Fields
Question details
A mail-merge macro halts with error 5941 when attempting to read specific checkbox data fields.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Running a VBA macro for a mail merge that interacts with checkbox content controls to read data fields.
- Observed behavior
- The macro throws 'Error 5941' because it cannot locate the requested data field. This failure consistently occurs when the data field name begins with a numeral, such as '100Yr_Gage'.
Keep your source data file (such as Excel or Access) open on a second monitor and press Alt + F11 in Word to launch the VBA Editor so you can actively inspect the variable names causing the failure.
Rename Source Fields to Begin with a Letter
Prevent Word from automatically altering your field names by modifying your data source headers so they start with a letter rather than a number.
When a merge-field name begins with a numeral (e.g., '100Yr_Gage'), Microsoft Word automatically prefixes it with 'M_' to comply with its internal bookmark naming restrictions. Because your VBA macro still looks for the original name without the prefix, it fails to find the field and triggers Error 5941.
Navigate to the Excel spreadsheet or database file that you are using as the source for your mail merge.
Locate any column headers that start with a number. Edit them so they begin with a letter (for example, change '100Yr_Gage' to 'Gage_100Yr').
Save the data source, reopen your Word document, and update your mail-merge fields to reflect the new column headers.
Right-click the corresponding checkboxes in your Word document, select 'Properties', and update the 'Title' and 'Tag' fields to match the exact new field names.

Verify Exact Text Matching for the cbtag Variable
Ensure that the content control tag exactly matches the field name in the DataFields collection, including spaces and capitalization.
Run Macros and Mail Merges Smoothly with WPS Office
If you are frustrated by Microsoft Word's strict internal naming conventions and sudden macro errors, consider switching to WPS Office. It provides robust support for document editing, mail merge, and VBA macros in a lightweight, free alternative.
- 1. Download and Install: Visit the official WPS Office website to download and install the free suite on your computer.
- 2. Open Your Document: Launch WPS Writer and open your existing Word document along with your data source.
- 3. Enable Macros: Access the Developer tab, enable macros, and run your mail-merge script without hassle.

Frequently Asked Questions
What does VBA Error 5941 mean in Word?
Error 5941 translates to 'The requested member of the collection does not exist.' In the context of a mail merge, it means your macro is trying to read or manipulate a data field name that Word cannot find in the current data source.
Why does Word add an 'M_' prefix to some of my merge fields?
Word has strict internal rules for bookmarks and variables, which require them to begin with a letter. If a data source column header starts with a number, Word automatically adds the 'M_' prefix to make it a valid internal name, which often breaks VBA macros that are looking for the original name.
How can I check the exact value of a variable during a macro error?
When the error dialog box pops up, click the 'Debug' button. This opens the VBA Editor. While the code is paused, you can simply hover your mouse cursor over any variable (like cbtag) to display a tooltip showing its current value.




