-
I try to open a word document to make changes but it gives error message:
Run-time error '429'
ActiveX component can't create object
my test code is as following:
Option Explicit
Dim AppWord As Word.Application
Dim AppDoc As Word.Document
Private Sub Form_Load()
Set AppWord = New Word.Application
Set AppDoc = AppWord.Documents.Add(App.Path & "test.doc")
Print AppWord.Name
End Sub
any idea? thanks.
-
It looks like you are missing the backslash in the path. Try
Set AppDoc = AppWord.Documents.Add(App.Path & \test.doc")
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
[This message has been edited by MartinLiss (edited 02-13-2000).]
-
yes, the missing slash is one of the mistakes. but the real problem is coming from:
Set AppWord = New Word.Application
this is where the error message from and the compiler gets stuck in here.
should that be a problem that I am using WIndows NT to develop my app?
-
No, I use NT and have an app that writes to Word and I have no problems. In your post it looks like you have AppWord defined in the form that uses it. If that's not the case, move the Dim (and it probably should be "Public") there.
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
-
I changed back to 'public' but still doesn't work...
i am sure i have the 'Microsoft Word 8.0 Object library' in the 'References'
P.S. the app is using 'Standard.Exe' to develop.
thanks
-
you're not using the right syntax, it should be:
set AppDoc = CreateObject(, "Word.Application")
this should do the job (please let me know if it does...)
-
-
go to vb6 click on Projects then on references and make sure microsoft activx data objects library is selected.
That sounds to me what the problem is try that bet ya it works!!!!!!!
Chow
:)