Mailmerge Database Access read write issue on migrating to 64bit W7 RRS feed

  • Question

  • Asked this on the Excel IT pro site and suggested to ask here as well:

    Running an automated mailmerge VBA process I get a

    "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data"


    The mailmerge between Excel & Word sends 100's of word mail files as attachments to email addresses using outlook, all the code is in a VBA script in the source excel file. This worked fine in XP & office 2010 (32 bit), but now since switching to W7E 64bit SP1 & Office 2010 it gets about 25% of the way through the exercise (so sends some fine) but then falls over.

    Has anyone got any idea's on why this now fails part way through?

    Code calling the mailmerge is as follows

    ActiveDocument.MailMerge.OpenDataSource Name:=DataSource _
            , ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
            AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
            WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
            Format:=wdOpenFormatAuto, Connection:= _
            "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=" & DataSource & ";Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=35;Jet OLEDB:Database L" _
            , SQLStatement:="SELECT * FROM `'To Merge$'`", SQLStatement1:="", SubType:=wdMergeSubTypeAccess
        With ActiveDocument.MailMerge
            .Destination = wdSendToNewDocument
            .SuppressBlankLines = True
            With .DataSource
                .FirstRecord = wdDefaultFirstRecord
                .LastRecord = wdDefaultLastRecord
            End With
            .Execute Pause:=False

    Thursday, September 25, 2014 3:51 PM

All replies

  • Do you have the 64 bit version installed regarding the Microsoft Access Database Engine 2010 driver?

    There are 2 versions, 32 bit and 64 bit, I guess you will need the 64 bit.

    Microsoft Access Database Engine 2010 Redistributable

    Hope this helps,

    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"

    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

    • Marked as answer by OneDs Friday, September 26, 2014 11:45 AM
    • Unmarked as answer by OneDs Friday, September 26, 2014 11:45 AM
    Thursday, September 25, 2014 4:44 PM
  • OK so Office 2010 is 32bit even though W7E is 64 bit, I have downloaded and run the 32bit redistributable restarted and run access, to no effect.

    The the error messages I am getting, word trips out first, with a:

    "Error has occurred: MS access database engine cannot open or write to the file...... blah blah"

    Click OK

    Then have a "Data Link Propoerties" msgbx

    Click OK

    I then a "File in use" msgbx.

    Select Notify and then click OK

    I Can now getto the excel VBA window

    With a "MS Excel is waiting for another application to complete an OLE action." msgbx, click OK.

    From that point I get to the run time error end/debug message in the VBA code click debug and set the process of again does another 25% and falls over again.

    Friday, September 26, 2014 11:43 AM