Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

active x error when accessing word with excel

Status
Not open for further replies.

msstrang

Programmer
Sep 19, 2005
62
US
i am writing a vba code that opens a word document that already exists, and then addes certain text to the document in predermined places.
my only problem is that when i try to open the word document, or any word document with my vba code that is in excel, i get the following error:

"Active X component can't create object"

i'm not sure what i am doing wrong.
any help would be greatly appreciated.
 
sorry, it completly slipped my mind. thank you for reminding me.
the funny thing is, sometimes out of the blue this will just start working, and then i'll start getting that error without making any changes at all. what causes this error in the first place?

Documents.Open Filename:= _
"C:\Documents and Settings\Marcus\Desktop\outlook vba\Envelope.doc", _
ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
 
Replace this:
Documents.Open
with something like this:
your Word.Application object here.Documents.Open

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
actually, it turns out i only get this error if my microsoft outlook isn't open. the funny thing is, this program doesn't deal with outlook at all. i think on monday i'll check my references to see if i do have outlook references if removing that reference solves my problem all together.
kinda strange though. thanks for your help anyways.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top