How to Fix Word MailMerge OpenDataSource Macro Error After Update
Question details
Users experience a macro-related error when a VB.NET application attempts to execute the MailMerge.OpenDataSource method after an Office update.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Running a VB.NET application that integrates with Word to generate and merge documents automatically.
- Observed behavior
- The system throws an error stating that the MailMerge.OpenDataSource method is unavailable because a macro is currently running, which blocks document generation.
Verify your current Microsoft Office version number (specifically if you are on version 2211) and ensure your document templates are stored on a local drive rather than a restricted network location.
Update Microsoft Office to Version 2302 or Later
Microsoft resolved this bug in build 16130.20128. Updating your Office client is the most reliable way to restore MailMerge functionality without changing your application code.
The issue was caused by a change in security policies regarding internet macros introduced in version 2211. Upgrading to the Current Channel Preview build 16130.20128 (Version 2302) or newer provides an official fix.
Launch Microsoft Word, click on 'File' in the top left corner, and select 'Account' from the bottom left menu.
Under the 'Product Information' section, click on the 'Update Options' dropdown and select 'Update Now'.
Wait for the update process to complete. Ensure your version number is at least 2302 (Build 16130.20128) and restart your VB.NET application to confirm the mail merge runs without error.

Modify Application Code to Use Documents.Add Workaround
If you cannot update Office immediately across your organization, modifying your VB.NET application to use the Add method instead of Open can bypass the macro block.
Use WPS Office for Reliable Document Automation
If Microsoft Office updates frequently disrupt your workflow with unexpected bugs, consider switching to WPS Office. It is a lightweight, highly compatible alternative that supports macros and seamless document processing without the overhead.
- 1. Download and Install: Get WPS Office from the official website and run the simple installation process.
- 2. Open your Document: Launch WPS Writer and load your mail merge templates without formatting loss.
- 3. Run Macros: Enable macros in WPS Office to continue executing your automated document generation tasks smoothly.

Frequently Asked Questions
Why do I get a 'macro is running' error during MailMerge after updating Office?
This misleading error often occurs due to a bug introduced in Office version 2211 related to security policies blocking content execution from the internet, which inadvertently causes MailMerge.OpenDataSource to fail.
Can I fix the MailMerge error by adding the template to a Trusted Location?
Previously, placing templates in a Word Trusted Location worked as a workaround. However, after the version 2211 update, this method is no longer effective for many users. Updating Office is the recommended solution.
Is there a coding workaround for the OpenDataSource error?
Yes. Developers can change their VB.NET application code to use the Documents.Add method instead of the Documents.Open method. This bypasses the security trigger block until the Office application can be updated.




