Click here to Skip to main content
12,998,394 members (72,306 online)
Rate this:
Please Sign up or sign in to vote.
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 6-Aug-12 2:44am
Updated 6-Aug-12 18:58pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170622.1 | Last Updated 7 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100