Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Class does not support Automation or does not support expected int

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
William - 22 Aug 2005 17:09 GMT
Hi,

G'd morning. In Office 2003, I created a Word template which has  a word
document, VBA code, and couple of FORMs. And, I'm getting very strange error
when I change the template.

I added a new textbox, an activeX obj, to the word document, but it seemed
that the old document, created without the new textbox, didn't like the new
textbox somehow, I think.

I got the following error:
Run-time error '430':
Class does not support Automation or does not support expected interface.

the code:
ActiveDocument.txtCompanyName.text = "My Company"

txtCompanyName is the name of the textbox created before.

If I delete the newly created obj from the template, all the old documents
work fine with the code.

I don't know if there is any change in Office 2003 on how to reference
ActiveX obj. Or, I should register the objs before I reference to them in VBA
code.

Is anyone has come across this type of problem?

Thank you very much.

Will.
Signature

 

Cindy M  -WordMVP- - 23 Aug 2005 14:57 GMT
Hi =?Utf-8?B?V2lsbGlhbQ==?=,

I'm not clear about how all these things work together, here. you have a
template. In that template you've inserted ActiveX controls, with code? Do you
also have UserForms? Or do you mean something else by "Forms"?

But what's this "document" to which you refer? Are you creating a new document
from the template, then trying to add ActiveX controls to that? Or something
else?

In which code module is the code you show us? Is ActiveDocument supposed to
refer to a document generated from the template, or the template itself? Have
you see the article on using ActiveX controls in Word, on the MSDN site? It
discusses some issue concerned with automating ActiveX controls in documents,
where the code is contained in the attached template.

> G'd morning. In Office 2003, I created a Word template which has  a word
> document, VBA code, and couple of FORMs. And, I'm getting very strange error
[quoted text clipped - 19 lines]
> ActiveX obj. Or, I should register the objs before I reference to them in VBA
> code.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
William - 24 Aug 2005 16:47 GMT
Hi Cindy,

the template has couple userforms, modules with VBA code, and ActiveX
controls on the template.

all the changes are made to the template. when a user creates a new doc from
the template, the new doc will have the latest changes to VBA code or ActiveX
contols.

it seems that if i add a new activex control to the template, the old doc
without the new activex control but has a reference to the template is not
working. for example, i created a new obj called address. and, the
txtCompanyName text box obj already existed before. ActiveDocument is the doc
created from the template, and is the active document.

> > the code:
> > ActiveDocument.txtCompanyName.text = "My Company"
> >  
> > txtCompanyName is the name of the textbox created before.
> >  
> > If I delete the newly created obj from the template, everything works fine.

Thanks,

will

Signature

 

> Hi =?Utf-8?B?V2lsbGlhbQ==?=,
>
[quoted text clipped - 43 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.