Microsoft KB Archive/115834

{|
 * width="100%"|

GP Fault Closing Template Attached to Mail Merge Data File

 * }

Q115834

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c

-

SYMPTOMS
An "illegal instruction" error may occur in Word 7 when you close a document based on a template that is attached to a mail merge data file. In Windows 3.x general protection (GP) fault may occur The GP fault occurs whether you save the main document or not. In other words, the GP fault occurs when you close a mail merge main document you created using a main document template.

Note: Sometimes, before the GP fault, the following error message occurs:

An application called via DDE did not respond to the Exit command.

CAUSE
The GP fault occurs if you used DDE (dynamic data exchange) to create the mail merge data file attachment in the template. The problem occurs regardless of which main document type you create (namely Form Letters, Mailing Labels, Envelopes, or Catalog).

The problem does not occur if you used Open Database Connectivity (ODBC) to attach the data file.

For example, this problem occurs if you attach a Microsoft Excel workbook or Microsoft Access database as a mail merge data source using DDE.

STATUS
Microsoft has confirmed this to be a problem in Word versions 6.0, 6.0a and 6.00c for Windows. This problem was corrected in Word version 7.0 for Windows 95.

WORKAROUNDS
Method 1:

When you create a template for a mail merge main document, use the following procedure to attach the data file using ODBC instead of DDE:

 From the Tools menu, choose Mail Merge. If you have not yet done so, choose the Create button to designate the template as a mail merge main document. In the Mail Merge Helper dialog box, choose the Get Data button. From the menu that appears, choose Open Data Source. In the Open Data Source dialog box, select the Confirm Conversions option so an X appears in the check box. Select the database and then choose OK. In the Confirm Data Source dialog box, select the ODBC conversion method for your data source. For example, if you are attaching a Microsoft Access database, select MS Access Databases via ODBC (*.mdb) or MS Access 2.0 Databases via ODBC (*.mdb). Choose OK. Method 2:

If you want to use DDE to attach the data file, you can avoid the GP fault problem by closing the DDE channel to the data file before you close your Word document. You can add the following AutoClose macro to your template to close the channel:

            Sub Main MailMergeReset End Sub WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.