error 430 Class doesn't support OLE Automation

jxd22
jxd22 used Ask the Experts™
on
What am I missing I create a word document and get automation error 430 Class doesn't support OLE Automation.  Now the program works on several versions of word, but I am having a problem with a version of Word XP.  On the test machine, running Office XP, there are no errors: the object is created, the document is generated and everything is fine.  But when distributed the program blows up on certain versions of Office, mostly full versions of XP.

'In declarations

Private gdocWord As Object
Private gappWord As Object

'In a sub

Set gappWord = CreateObject("Word.Application")
Set gdocWord = gappWord.Documents.Add

'Later in another sub

gdocWord.Application.Visible = True
gappWord.Documents(gdocWord).Activate
?

'These subs are located in the same module as the declarations.  Whats wrong with this code? Why would I get error only on XP machines?  Is there a more reliablel way to code this object??????
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try this:

gappWord.Documents(gdocWord.Name).Activate
Author of the Year 2009

Commented:
Hi jxd22,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

jxd22, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial