Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 Excel VBA
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
comred1.1K
Edited 6-Aug-12 18:58pm
v4

1 solution

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

Solution 1

What you want to do is called exposing .NET components to COM.
 
See http://msdn.microsoft.com/en-us/library/zsfww439.aspx[^]
  Permalink  
Comments
comred at 7-Aug-12 0:43am
   
Thanks Philip, but would you tell me. how can I make my dll exposed to COM programmatically??
Philip Stuyck at 7-Aug-12 2:07am
   
Have you tried google yet ?
comred at 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
0 OriginalGriff 210
1 Richard MacCutchan 100
2 kbrandwijk 90
3 ProgramFOX 80
4 Mukesh Bhagat 65
0 Sergey Alexandrovich Kryukov 9,050
1 OriginalGriff 8,151
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 7 Aug 2012
Copyright © CodeProject, 1999-2014
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