+ Reply to Thread
Results 1 to 6 of 6

Erratic VBA Mail Merge Behaviour

  1. #1
    Registered User
    Join Date
    09-05-2017
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Erratic VBA Mail Merge Behaviour

    Hello,

    I have successfully made an Excel document that allows me to run a mail merge into a Word template using VBA. It works perfectly on my machine, and on various colleagues machines too. However about 25 percent of the people that run it seem to have a problem where it gives an error:

    Error Number: 5922
    Error Description: Word was unable to open the data source.

    The template is downloaded from a website before the data is merged so everyone has the exact same template and same document. Im looking for advice on how to troubleshoot this and find the cause of the issue...

    Machines are technically identical as all work machines (but it wouldn't shock me if they had differences, everyone runs Office 2010.)

    Mail Merge code:

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

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Erratic VBA Mail Merge Behaviour

    Just a guess; it might have something to do with how the network drives are mapped on each computer. Run the code on the failing computers and inspect the file paths and compare them to the computers that work just to see if there is a difference.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    09-05-2017
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Re: Erratic VBA Mail Merge Behaviour

    Thank you for your reply,

    I did consider something like this. But no network drives are used.
    The template is downloaded from a web URL and the VBA always successfully gets the template into the same folder as the Excel work book.

    Thanks,

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Erratic VBA Mail Merge Behaviour

    Don't have any other ideas. It may still be worth it to check the paths for differences if only to eliminate it as a possibility.

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

    Re: Erratic VBA Mail Merge Behaviour

    I don't see anything obviously 'wrong' with your code, but you might try:
    Please Login or Register  to view this content.
    Since you're evidently using early binding, it's probably better to define your Word variables accordingly. It may also be worthwhile disabling Word's alerts. And, since ThisWorkbook.Path & "\" & ThisWorkbook.Name amounts to ThisWorkbook.FullName, you may as well use that.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  6. #6
    Registered User
    Join Date
    09-05-2017
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    5

    Re: Erratic VBA Mail Merge Behaviour

    Thanks for the help. Ill take the improvements on board. Yes I bind Word early to complete a version check before we do anything.

    The problem proved to be that the machines that failed to run where missing ACEODBC.DLL a quick roll out from IT seems to have solved all issues.

    (if there is a way to do this without ACEODBC.DLL this would be good... but since you cant even manually mail merge without it it seems doubtful.)

    Thank you for the help,

+ 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: 06-24-2015, 02:34 AM
  2. Replies: 0
    Last Post: 01-05-2015, 07:35 AM
  3. Replies: 2
    Last Post: 01-22-2013, 11:37 AM
  4. Erratic behaviour of .Find
    By goneps in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-05-2012, 05:26 PM
  5. Replies: 2
    Last Post: 07-12-2012, 08:11 PM
  6. Replies: 0
    Last Post: 04-21-2006, 03:40 PM
  7. [SOLVED] Erratic Behaviour of Buttons
    By Roger PB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-05-2005, 01:06 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