+ Reply to Thread
Results 1 to 4 of 4

Extra pages added at end of VBA mail merge

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Extra pages added at end of VBA mail merge

    Hi All,

    Might not be the best place to post this, but perhaps someone may be able to give some insight or help. I have a excel logsheet filling a MS Word template for a report. The data transfers to the Word document properly, but as the code runs, it seems to add blank template pages to the end of the Word document. So, instead of a 2 page document being saved, there is 2 pages of data followed by about 50 copies of the blank template. I have looked at the Word Template for format markers that may be adding page breaks or something where I was not expecting it. I didn't see anything out of the ordinary.

    Here is the code for the mail merge. I had used this in the past on other things without issue, after making file location changes and what not.
    Please Login or Register  to view this content.
    If I step into the code, I can see the pages adding to the Word Document at the last End With.


    As always, thank you for what help you may give.


    Patrick
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Extra pages added at end of VBA mail merge

    Question: How many extra rows do you have in the Excel Source?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Extra pages added at end of VBA mail merge

    Dflak,

    Thanks for asking the right question. I found an active cell on row 205. After deleting rows from the end of my data to that active cell, the problem corrected.

    Many thanks for your help.

    Patrick

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Extra pages added at end of VBA mail merge

    I am glad to have put you on the right track.

+ 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. Replies: 0
    Last Post: 01-05-2015, 07:35 AM
  2. Replies: 3
    Last Post: 05-08-2014, 07:11 PM
  3. Extra rows added...
    By edstewart in forum Excel General
    Replies: 5
    Last Post: 08-01-2012, 09:39 PM
  4. Replies: 2
    Last Post: 07-12-2012, 08:11 PM
  5. Replies: 2
    Last Post: 04-24-2012, 11:07 AM
  6. Extra Series being Added
    By MFeightner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2010, 10:44 AM
  7. [SOLVED] Extra added to a script
    By Bob in forum Excel General
    Replies: 2
    Last Post: 09-06-2005, 07:05 PM

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