logo
search
Template Issues

How to Automatically Handle Word Mail Merge Data Source Prompts with VBA

Kushani NimanthikaKushani Nimanthika Oct 9, 2026 869 views

Question details

The user wants to find a way to bypass or automatically manage the default SQL prompt that appears when opening a mail merge template, ensuring the data source reconnects seamlessly.

How to Automatically Handle Word Mail Merge Data Source Prompts with VBA
Product
Microsoft Word
Device & OS
not provided
Scenario
Opening a saved mail merge template that is linked to a spreadsheet data source.
Observed behavior
Word displays a prompt asking users whether to reconnect to the spreadsheet data source. If users select 'No', the connection is dropped and the data source information is lost.
Before you start

Ensure you have administrative privileges to access the Word Startup folder, and only install VBA macros or templates from trusted sources to prevent security risks.

Solution 1Recommended

Install the Merge SQL Message Eliminator Add-in

Use a VBA-powered Word add-in template to store data source details and provide controlled connection options when reopening mail merge documents.

By utilizing a dedicated VBA add-in, you can bypass the default Microsoft Word SQL prompt. The add-in works by saving the data source variables directly into the document when you close it, allowing for automatic reconnection prompts upon reopening.

1
Locate the Word Startup Folder

Open Windows File Explorer, type '%appdata%\Microsoft\Word\Startup' into the address bar, and press Enter to open the folder.

2
Install the VBA Template

Place your downloaded 'MergeSQLMessageEliminator.dotm' file into this Startup folder so it loads automatically when Word starts.

3
Save Data Source Details on Close

Perform your mail merge setup as usual. When closing the document, a dialog will appear from the add-in; click 'OK' to save the data source variables securely into the document.

4
Reopen and Reconnect

When you reopen the document, a custom message box will appear. Click 'OK' to reattach the existing data source automatically, or click 'Cancel' to open the document without it and attach a new spreadsheet.

Install the Merge SQL Message Eliminator Add-in
Missing Data Sources: If the original data source file is moved or deleted, the add-in will notify you. Clicking 'OK' will prompt the Select Data Source dialog so you can choose the new file location.
Free Microsoft Office alternative

Experience Seamless Mail Merge with WPS Office

Tired of dealing with complex VBA add-ins and recurring SQL data source prompts in Microsoft Word? WPS Office provides a streamlined, built-in Mail Merge feature that requires no advanced configuration, ensuring your spreadsheets stay seamlessly connected.

  1. 1. Open WPS Writer: Launch WPS Writer and open your document template.
  2. 2. Access the Mail Merge Tool: Navigate to the 'References' tab and click on the 'Mail Merge' button.
  3. 3. Connect Your Spreadsheet: Click 'Open Data Source' to link your spreadsheet. WPS handles the connection securely without repetitive SQL warning prompts.
Fully compatible with Microsoft Word (.docx) and Excel (.xlsx) formats.Built-in, intuitive Mail Merge feature without the need for complex VBA workarounds.Free, lightweight, and highly optimized for seamless daily document workflows.Familiar user interface that requires zero learning curve for Office users.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Word ask to reconnect to the data source every time I open a mail merge document?

By default, Microsoft Word displays an SQL security prompt whenever you open a document linked to an external data source. This is a built-in security measure designed to prevent malicious scripts from extracting or modifying data on your computer without your knowledge.

Where is the default Word Startup folder located on Windows?

Unless it has been customized by an IT administrator, the default Word Startup folder on Windows is located at %appdata%\Microsoft\Word\Startup. You can access it easily by pasting this path directly into your Windows File Explorer address bar.

Can I disable the Word SQL data source prompt using the Windows Registry?

Yes, advanced users can disable this prompt globally by adding a 'SQLSecurityCheck' registry key set to 0. However, using a VBA add-in is often safer and more flexible because it provides per-document control without altering system-wide security settings.

Will these VBA macros run automatically?

Macros will only run automatically if your Microsoft Word Trust Center settings allow them. For add-ins placed in the default Startup folder, Word typically treats them as trusted, but you should always verify macro security settings in the Trust Center.