|
-
Feb 12th, 2000, 11:01 AM
#1
Thread Starter
Junior Member
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.
-
Feb 12th, 2000, 02:30 PM
#2
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).]
-
Feb 13th, 2000, 03:09 AM
#3
Thread Starter
Junior Member
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?
-
Feb 13th, 2000, 04:09 AM
#4
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!"
-
Feb 13th, 2000, 05:31 AM
#5
Thread Starter
Junior Member
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
-
Feb 13th, 2000, 06:40 AM
#6
Addicted Member
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...)
-
Feb 20th, 2000, 05:59 AM
#7
Addicted Member
-
Feb 20th, 2000, 08:50 AM
#8
Lively Member
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

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|