VBA Mail Merge Overflow error

  • I'm using the below code to automate the saving of a large number of documents produced by a mail merge.

    The columns in excel are "Docfolderpath", which contains the file path to a folder to save that specific document after it's created in the merge, and "docfilename" is the filename it's saved as. One record is saved at a time.

    The problem is that when I use a much larger spreadsheet (1000 rows with 25-30 columns of data), I get an overflow error when I start the macro. Bear in mind that I still get this error even when I filter for a specific metric in the mail merge

    Any help to change the code would be appreciated, thanks

    Here's a pic of a scaled-down version of the spreadsheet being used


  • Pictures aren't much help, especially on a file sharing site. If you read the Forum Rules you will see that all files should be attached to the Forum.

    Attach an example workbook.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!