+ Reply to Thread
Results 1 to 7 of 7

12:00:00 AM - Mail Merge field - Unable to use DDE workaround

  1. #1
    Registered User
    Join Date
    12-02-2015
    Location
    Peterborough, England
    MS-Off Ver
    2007
    Posts
    19

    Unhappy 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    Hi guys,

    I'm having an issue with a letter mail merge in which certain merge fields are pulling from Excel into word as 12:00:00 AM, rather than the data stored on the table.

    The issue only seems to appear when proceeding letters have had a blank in this field (blank cells in Excel filled in with ="").

    As a workaround I've created a dummy letter on the beginning of the spreadsheet in which all fields have around 256 characters of text in them which appears to be holding the issue off, however, ideally like to find a workaround as it'll be a fairly inexperienced group of people using this merge and there's a chance the dummy document could end up in the post to a customer

    I've tried the DDE option which has worked in the past for previous projects, however, this is causing instant word crashes on the machines that I'll be deploying the merge on so it's a no-go this time round.

    Any ideas? Can't believe these issues are still present in the latest Word version!

  2. #2
    Registered User
    Join Date
    12-02-2015
    Location
    Peterborough, England
    MS-Off Ver
    2007
    Posts
    19

    Re: 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    Bump! Still struggling with this one!

  3. #3
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    Hello flakjack,

    Well, if "" value is causing you trouble, I'd try to replace them all, for example:

    If you have a table from A1 to C3, on D1 I'll enter in
    C3:
    Please Login or Register  to view this content.
    And then do a Ctrl - H (Replace), type in "Delete" in the "Find What" box, leave the "Replace with" blank, hit replace all, and then you can do it the old way? xd
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,842

    Re: 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    Quote Originally Posted by flakjack View Post
    Can't believe these issues are still present in the latest Word version!
    That's because you don't really understand how mailmerge works.

    By default, Word 2002 & later use the OLE DB provider to get merge data from an Excel workbook. Because the OLE DB provider is designed to return data in a way that is compatible with Access and other relational database packages, it requires a specific data type for each field, and every value in that field must have only that data type. In Excel, however, cells in a column (field) can have different data types. When the OLE DB provider gets data from an Excel column with mixed data types, it has to determine the data type for each column. The first 8 records are used for that (the 8 can be changed in the Windows Registry, but it’s not advisable to do so). Records that don’t conform to the determined data type are liable to not be handled correctly. To complicate matters, there are two text data types: "text" (up to 255 characters) and "memo" (can be longer than that).

    Some common mailmerge issues arising out of this include:
    • Numbers but not text or dates being output for some records; and
    • Text data being truncated at 255 characters.

    Ideally, one would ensure each field has only one data type. Workarounds include:
    • Inserting a dummy first record containing data in the format that is not being output correctly; or
    • Reordering the data so the first record has content in the format that is not otherwise being output correctly.
    Thus, if numbers appear but text and/or dates don’t, ensure the first record for that field has text or a date. Similarly, if text over 255 characters is being truncated, ensure the first record for that field contains more than 255 characters.

    While you say:
    certain merge fields are pulling from Excel into word as 12:00:00 AM, rather than the data stored on the table
    You haven't said what they're supposed to show.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Registered User
    Join Date
    08-23-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    SOLUTION TO 12:00:00 AM MAIL MERGE PROBLEM (CONSECUTIVE MEMO COLUMNS)

    Hi Guys

    I've been pulling what's left of my hair out for months on this problem i.e. the classic "12:00:00 AM" seeming to randomly appear in a MS-Word mail merge (MERGEFIELD) when executing the merge from a VBA routine in Excel (despite the manual mail merge working absolutely fine with > 1000 characters).

    It is indeed the > 255 character problem but does still occur despite inserting the dummy 8 rows padded out with dummy data in the target worksheet.

    I had 3 columns in sequence in this worksheet each containing up to 1500 characters (potentially). No matter what I tried Col 2 would always show "12:00:00 AM" regardless of the contents of the dummy or actual cells in that row (the cells in Cols 1 & 3 merging fine with 1000+ characters each).

    Then I thought, just as a throw-away test, what happens if the merge cannot handle consecutive columns with > 255 characters. So I simply added a blank column - AND IT WORKED!!

    Conversely, as soon as I removed this dummy column the "12:00:00 AM" reappeared following the merge in the MS-Word doc!

    So the moral of this story seems to be, separate any columns that are likely to have > 255 characters (i.e. will be treated as memo fields by the mail merge), with either dummy columns or genuine data columns such that consecutive memo cols are separated.

    That's it.

    Hope somebody finds this solution useful.
    Cheers

  6. #6
    Registered User
    Join Date
    02-02-2017
    Location
    Illinois
    MS-Off Ver
    2013
    Posts
    1

    Re: 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    I had same issue. Things were fine until something unknown happened and Excel text field kept displaying 12:00am in Word. I tested with new blank Word documents with same results with same single text field from same Excel sheet. Oddly if I add another column in Excel sheet which references same text field (ex. new column H2=B2 where B2 is the text field in question), then the original text field works fine in Word without using the secondary and equal calc'd field value. But if that new calc'd field column is removed, the original text field again displays 12:00am in Word. So I then created new workbook and sheet, used the same Work document and problem went away but a different problem later arose where last text field in Word was truncated at 255 char. After more research, I learned what seems to be the correct way to link Excel 2016 or later to Work for a Mail Merge using DDE.

    The fix for me was to strip out mail merge features from the Word document and to make Normal Word Document (under the Start Mail Merge ribbon drop down). I then closed, reopened and followed these steps:
    1) When you connect to the Excel file via Use an Existing List selection under Select Recipients ribbon drop down a dialog will open titled Confirm Data Source and in my case with just one option (OLE DB Database Files) but don't choose that option.
    2) Check Show All check box then select MS Excel Worksheets via DDE (*.xls), then click OK.
    3) Eventually you will see another dialog box which asks if you want Named or Cell Range and the Entire Spreadsheet is already inputted for selection and say OK
    Next the process will open your spreadsheet and if you flip back to Word, you will be able to hopefully be able to select and use fields without the two challenges I experienced.
    Last edited by eskimopie; 03-05-2021 at 10:22 PM. Reason: Addional research

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,842

    Re: 12:00:00 AM - Mail Merge field - Unable to use DDE workaround

    Quote Originally Posted by eskimopie View Post
    The fix for me was to strip out mail merge features from the Word document and to make Normal Word Document (under the Start Mail Merge ribbon drop down). I then closed, reopened and followed these steps:
    Stripping out all the mailmerge features requires nothing more than answering 'No' to the SQL prompt when you open the mailmerge main document. You can then connect to whatever data source you want, with whatever connection method you prefer.

    Using DDE as a workaround to what is clearly a problem with your source data is a kludge. My reply in post #4 sets out the correct way of handling such issues.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Field codes use in mail merge
    By Skiingbeancounter in forum Word Formatting & General
    Replies: 4
    Last Post: 07-08-2014, 10:13 AM
  2. Using a date field in mail merge
    By triciaodd in forum Excel General
    Replies: 1
    Last Post: 07-03-2014, 08:14 PM
  3. Use field headings in my mail merge
    By thefribbler in forum Word Formatting & General
    Replies: 1
    Last Post: 06-03-2014, 08:30 PM
  4. Formatting Complex Mail Merge Field
    By Jenn68 in forum Word Formatting & General
    Replies: 12
    Last Post: 06-01-2012, 07:57 AM
  5. Re: Using a date field in mail merge
    By Dave Peterson in forum Excel General
    Replies: 0
    Last Post: 01-26-2006, 10:35 AM
  6. [SOLVED] How to filter on a date field during mail merge
    By SWADoug in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  7. [SOLVED] How to filter on a date field during mail merge
    By SWADoug in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1