+ Reply to Thread
Results 1 to 4 of 4

Macro errors before save of mail merge document

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

    Question Macro errors before save of mail merge document

    Hi Everyone,

    I am having problems with my latest macro. It is a mail merge from excel to merge fields in MS Word. The merge works correctly, but I want the word file to save to a specific folder with a specific name as defined by the contents of cell C52 on my "form" worksheet. I have borrowed from another macro I am using to create a directory and name my excel file. That code is here:

    Please Login or Register  to view this content.

    My mail merge macro fills in the fields but errors out before the save on the line denoted with **. The error listed is 438 - Object doesn't support this porperty or method...

    Can anyone help me sort this out?

    Please Login or Register  to view this content.
    Thank you very much,

    Patrick

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro errors before save of mail merge document

    I think you can't refer to wd because wd is the application and not the active document. You can try to change the row:
    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.
    Regards,
    Antonio

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

    Re: Macro errors before save of mail merge document

    Thank you for the reply. After the changes you suggested, I no longer get the error. The file is saving but not to the desired location. I am not sure what I need to change to get the merge document to save in the directory created by my 1st macro. Any other suggestions?


    Thanks,
    Patrick

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro errors before save of mail merge document

    Hi Patrick

    This line of code includes MyFile in the definition of the path (sDir)
    Please Login or Register  to view this content.
    This line of code includes MyFile in the path again
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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