Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Word mail merge failure (Word 2000 / Access 2000)

    I have a Word mail merge that I invoke from Access VBA. I run it at least once per day.

    Recently it started failing on this statement: Set loWd = New Word.Application
    with this error message:

    Run-time error '-2147221231 (80040111)':
    Automation error
    ClassFactory cannot supply requested class

    The cure for me is to uninstall Word, then to re-install Word. Then the VBA mail merge works fine.

    I am curious about the cause of the error. I have LOTS of software installed, and so far I have not been able to identify a cause and effect relationship for the failures. I wold love to fix it so it doesn't keep breaking on me.

    If anyone has experienced this, or can enlighten me, I would be most grateful!
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word mail merge failure (Word 2000 / Access 2000)

    Do you have more than one version of Microsoft Office installed? That seems to be a possible scenario for this error. If you get this error again, check Tools | References... in the Visual Basic Editor to see if you have a reference to the correct Word object library (9.0 for Word 2000)

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Re: Word mail merge failure (Word 2000 / Access 20

    Hans, I have been using Office 2000 exclusively, so I don't have any other versions installed.

    The first thing I did when I got the error was to check the references in my VBA project. I had the correct Word 9.0 library reference, but it wouldn't let me create a new instance of Word.
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word mail merge failure (Word 2000 / Access 20

    I'm afraid I don't know what causes your problems then, apart from a corrupt installation, which uninstalling/reinstalling would fix, as in your situation. But "corrupt installation" is not a very satisfactory explanation...

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word mail merge failure (Word 2000 / Access 2000)

    tough problem. it looks like something is corrupting the registry.
    you might want to try the following (make sure no instances of word are running - if you're not sure, reboot the computer)
    now click start->run and enter "winword /r" (according to mskb the switch for word2000 is /r (and not /regserver)) without the quotes and press enter. this will reregister word's automation classes.
    also, iirc, the 'set x=new "classname"' construct bypasses some stages in the creation of a class instance, so your problem could possibly be solved by using a
    dim loWd as word.application
    Set loWd = createobject("word.application")
    note:you can still use early binding for this statement and all your other statements if you leave the reference to the word object library.

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word mail merge failure (Word 2000 / Access 2000)

    I may be way off base here, but when I was working on this a while back, I had the worst time making my merged Word document open from Access. The code I wrote would go awry one way or another every second or third time. The first time it would open like a charm.

    I sat around and thought about it for a while and then decided on a simple command button linked to the already created merged Word document with a simple macro in the background that stated:

    Open App
    Maximize

    And in the properties section of the macro window what app I wanted open, eg. Crogram filesmystuffmerge.doc (Note I did put the merge.doc within the same folder as my database)

    Also a simple hyperlink to the merge doc on the form works fine...you can make it look like a command button with just a bit of formatting.
    Either way the link has already been established between the database and the word document through the use of the Office Links Icon on the standard toolbar and it:

    Worked everytime. Seemed simpler. Not sure if this is any help or not
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •