Word automation - Can't create object

E

EVRoss

Recently it appears that I cannot start Word through Access via VBA
automation even when using simple wizard produced setup. I am unsure when
this change took place but it could be related to automated updates from MS
or Symantec. Recently installed System Works 2005 so same could be
related... Error states "Automation error. Class factory cannot supply
requested class." Same error under Access 2002 or 2003. May be related to
the fact that I have more than one version of Word installed. Using Windows
XP Pro. Simple code follows that produces the error.

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

Dim oApp As Object

Set oApp = CreateObject("Word.Application")
oApp.Visible = True

Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub
 
J

Jonathan West

EVRoss said:
Recently it appears that I cannot start Word through Access via VBA
automation even when using simple wizard produced setup. I am unsure when
this change took place but it could be related to automated updates from
MS
or Symantec. Recently installed System Works 2005 so same could be
related... Error states "Automation error. Class factory cannot supply
requested class." Same error under Access 2002 or 2003. May be related
to
the fact that I have more than one version of Word installed.

That is probably it. Uninstall one version, do a repair on the other, and
then try again. If you need to keep multiple copies of Word available for
testing purposes, get yourself a copy of VirtualPc, and set up a different
version on different virtual machines, so they can't interfere with each
other.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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