|
-
March 2nd, 2001, 08:53 AM
#1
interaction with word thru vb -- urgent
Hi,
I am basically java developer and today need a little vb program to do word documents conversion to html...when i try to create word object in vb with Word.Application.Documents.Open(...)..the compile is ok but getting run time error saying that the "activex cannot create the object"..
Please someone help...as its urgent...
-
March 2nd, 2001, 09:09 AM
#2
Re: interaction with word thru vb -- urgent
I am not sure about the rest of your code, but that looks very familiar to several errors I have recieved in the past. If you code goes like I think it does, what is happening is that the Word application is not finished opening before you try to open the document with your word.application.documenst.open statement. One way to avoid this is to put the open in a loop like...
on error resume next
do
err=0
word.application.documents.open()
doevents
loop until err=0
If you get an error in the code then the document was not opened and your loop continues until the word application becomes available and is able to open the document.
Hope this helps
-
March 2nd, 2001, 09:13 AM
#3
Re: interaction with word thru vb -- urgent
Use a Documents.Add before Open. I don't know why this is needed, but it works.
-
March 2nd, 2001, 09:55 AM
#4
Re: interaction with word thru vb -- urgent
Thanks guys..
I am able to overcome this by
Dim objWord As Word.Application
then
Dim objDoc as Word.Document
objWord = CreateObject("Word.Application")
objDoc = objWord.Documents.Open("filename")
But now i am having different problems...
I have posted them here...
Thanks anyway
-
March 2nd, 2001, 11:15 AM
#5
Re: interaction with word thru vb -- urgent
"activex cannot create the object"... you referenced the Word runtime libraries
but maybe you're running your application on a machine without word on it, or you have some matter with DCOM or DCOM+ (no WindowsNt? haihaihaihai...). I am afraid I cannot help more, but VB is a lot worse than Java about COM components.
You should post here your question again, trying to explain better your matter. Sooner or later, a truly Guru will answer
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|