Problem in macro referencing a Com Class built on Dotnet 2.0

R

Rohim Uddin

Hi Everyone,
I am having a hard time working with Com dll with Word 2003. This is my
first post in this forum and i desperately need help. I thank you in advance.

Scenerio:
I created a Com Class in VB.Net 2.0, which has some public properties,
functions. I use WebClient in the class to download data. I created the setup
using Deployment Wizard containing Test.dll and Test.tlb. I Install it in a
test system and reference the Test.tlb in a word Macro. i can create an
object of my com class. Set a property with text. Display the property in a
msgbox. The Code as follows:

Dim obj As New Testproject.TestClass
obj.MyStr= "The Macro works"
MsgBox (obj.MyStr)

Problems:
When i run the macro it gives me error as:
-2147024894
File or assembly name Testproject, or one of its dependencies, was not found.


Regards
Rohim
 
F

fumei via OfficeKB.com

Have you tried:

Set obj.MyStr= "The Macro works"

If MyStr is a Property of the class it needs to be Set.
 
R

Rohim Uddin

Hi,

Thank you for your answer. I tried using
Set obj.MyStr= "The Macro works".
It gave me another error as Invalid use of property. The way i build the
Setup project are:

Test.dll as vsdraCOM
Test.tlb as vsdraCOM

If i set the Test.dll as vsdraDoNotRegister while creating the setup, it
gives me another error as activex cannot be created, while i try to reference
in Word.

If i register both the files as COM then i can reference in a vb6 project
and it works fine.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top