Automation Error

M

michael

An Access application I have recently migrated to office
2003 is now generating an automation error: ClassFactory
cannot supply requested class ........... any ideas?
What I am attempting to do (on button click) is to open a
word document (for mailmerge) & datestamp the records
listed.

The offending code is:
Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open("C:\My Documents\
letter.doc")
 
C

Cindy M -WordMVP-

Hi Michael,

Never heard of "ClassFactory" before. Is this something
"Accessy"?

If it's also an unknown in the Access world, my feeling is
you might be running into a problem with an Addin in Word.

If you start Word up "manually", then use this, instead of
what you have, does it run?

Set objWord = GetObject(, "Word.Application")
Set objDoc = objWord.Documents.Open("C:\My Documents\
letter.doc")
An Access application I have recently migrated to office
2003 is now generating an automation error: ClassFactory
cannot supply requested class ........... any ideas?
What I am attempting to do (on button click) is to open a
word document (for mailmerge) & datestamp the records
listed.

The offending code is:
Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open("C:\My Documents\
letter.doc")

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

Michael

Cindy,

I opened up Word then ran the process with your amended
code and it worked as designed.

It would appear that the problem is "opening" Word from
Access - (so I have a temporary workround) - I was
thinking that I may be missing (or have a corrupted)
active-x control - but am not sure how to identify or
rectify this.

Michael
 
C

Cindy M -WordMVP-

Hi Michael,
I opened up Word then ran the process with your amended
code and it worked as designed.
OK, then we know it's not the document, itself, causing the
problem, since your code can open it. Let's try another
variation. This time, instead of the New keyword, try the
older CreateObject method:

Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\My Documents\
letter.doc")

If this works, then we've narrowed it down to the NEW
keyword + Word.Application. If it doesn't work, then we
probably need to be looking at something interfering with
Word starting up (and I rather hope it's this...).
It would appear that the problem is "opening" Word from
Access - (so I have a temporary workround) - I was
thinking that I may be missing (or have a corrupted)
active-x control - but am not sure how to identify or
rectify this.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

Michael

Cindy,

The revised code failed with exactly the same error as I
originally encountered.

Michael
 
C

Cindy M -WordMVP-

Hi Michael,
The revised code failed with exactly the same error as I
originally encountered.
OK, then something is interfering with Word starting up
properly, is my guess. Most likely an Addin. Have you
tested on a different machine at all?

On your development machine
- Check the Addins list in Tools/Templates and Addins.
Anything in there, and checked?

- Go to Tools/Customize/Commands, select the "Tools"
category, then look for "Com Addins" in the list on the
right. Drag that to the TOOLS menu. Close the dialog box

- Activate Tools/COM Addins and see if there's anything
in the list?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

michael

Hi there,

followed your instructions - only object was for OmniPage
Pro - which I unchecked then rebooted - no change to
behaviour.

I was wondering if there was a problem with the active-X
module or possibly how one could identify which module
was called for this automation?

Michael
 
C

Cindy M -WordMVP-

Hi Michael,
I was wondering if there was a problem with the active-X
module or possibly how one could identify which module
was called for this automation?
Have you tried uninstalling the OmniPage Pro addin? Did you
find this in the Templates and Addins or the COM Addins
list?

If in Templates and Addins, then chances are it's in Word's
Startup folder, which means it's being loaded each time
Word starts (even if you unchecked it the one time).

Try moving the file to another folder.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

michael

The Omnipage was referenced in its own directory - in the
COM add-ins. Where is Word's startup directory - just in
case there is something untoward there?

Thanks for al the ideas.

Michael
 
C

Cindy M -WordMVP-

Hi Michael,
Where is Word's startup directory - just in
case there is something untoward there?
That depends on the installation. You might find it listed
under Tools/Options/File locations; on newer installations
it would probably be in the profile's Application Data,
under Microsoft/Word

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top