P
passion_to_be_free
I am working on a project where I need word and excel to talk to each
other. I don't know if this should go in the Word users group or the
Excel users group, so I will post it in both (I'm new to users groups,
so it that is against the "users group etiquette" let me know)
I have been successful at automating Excel from Word, and that code
seems to work just fine. However, I now have an excel spreadsheet that
needs to talk to a word document. Everytime I try to create a new
Word.Application object, I get the dreaded "Run-time error 429: ActiveX
object can't create object." here is my code:
Sub Test()
Dim wApp As Object
Dim wDoc As Object
Set wApp = CreateObject("Word.Application")
Set wDoc = wdApp.Documents.Add
wApp.Application.Dialogs(wdDialogFileOpen).Show
Set wDoc = wApp.Documents(1)
wDoc.Range(Start:=0).Select
wDoc.Application.Selection.TypeText ("this is a test")
wDoc.Save
wDoc.Close
End Sub
The error happens on the Set wApp = CreateObject line. I've also tried
wApp = new Word.Application with the same results. I also opened Tools
has been checked.
All of the help files I can find on the internet deal with editing
registry keys and other PC only activities. I'm running Panther 10.2.8
and I am using Microsoft Office 2004. Does anyone know why this error
might be coming up? Why is it that I can automate excel from within
word, but when I try to automate word from excel, I get this error?
Thanks in advance.
other. I don't know if this should go in the Word users group or the
Excel users group, so I will post it in both (I'm new to users groups,
so it that is against the "users group etiquette" let me know)
I have been successful at automating Excel from Word, and that code
seems to work just fine. However, I now have an excel spreadsheet that
needs to talk to a word document. Everytime I try to create a new
Word.Application object, I get the dreaded "Run-time error 429: ActiveX
object can't create object." here is my code:
Sub Test()
Dim wApp As Object
Dim wDoc As Object
Set wApp = CreateObject("Word.Application")
Set wDoc = wdApp.Documents.Add
wApp.Application.Dialogs(wdDialogFileOpen).Show
Set wDoc = wApp.Documents(1)
wDoc.Range(Start:=0).Select
wDoc.Application.Selection.TypeText ("this is a test")
wDoc.Save
wDoc.Close
End Sub
The error happens on the Set wApp = CreateObject line. I've also tried
wApp = new Word.Application with the same results. I also opened Tools
References and made sure that "Microsoft Word 11.0 Object Library"
has been checked.
All of the help files I can find on the internet deal with editing
registry keys and other PC only activities. I'm running Panther 10.2.8
and I am using Microsoft Office 2004. Does anyone know why this error
might be coming up? Why is it that I can automate excel from within
word, but when I try to automate word from excel, I get this error?
Thanks in advance.