Click here to Skip to main content
15,880,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Experts,

I have my dll i.e. class library file made in .net. and a vba application. The code written in vba app need a function written in that particular dll. How can I refer that dll.

In .net its easy, because it follows xcopy deployment. But as i am new to vba, I don't know how to do it. Since my vba file will be distributed to the various clients, I can't afford to make that reference explicitly. i.e. going to tool and then checking component. It should be performed programmatically.

Do I need to install my .net dll on client's machine?? I am asking this because,
since I am not able find my dll with just copy and paste.. what I did is, I wrote CreateObject() method. But eventually I found this message on msdn link... "CreateObject():Creates and returns a reference to a COM object. CreateObject cannot be used to create instances of classes in Visual Basic unless those classes are explicitly exposed as COM components."

Anybody can give any hint or help please...

Can I do it by using shell command?? Does it help me to to register my dll on client's machine (programmatically)??
Posted
Updated 6-Aug-12 18:58pm
v4

1 solution

What you want to do is called exposing .NET components to COM.

See http://msdn.microsoft.com/en-us/library/zsfww439.aspx[^]
 
Share this answer
 
Comments
comred 7-Aug-12 0:43am    
Thanks Philip, but would you tell me. how can I make my dll exposed to COM programmatically??
Philip Stuyck 7-Aug-12 2:07am    
Have you tried google yet ?
comred 7-Aug-12 2:36am    
Last 12 hrs i am doing the same. Till now I've searched lots of links and blogs. I am confuse, what to use. Somebody has posted that in this kind of issues, where you are going to distribute your dll to your clients machine, you shuld go for shell function. But again its giving me some other errors like . file not found... Basically I want that my main logic should not be exposed to the client. thats why i went for making dll.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900