|
-
Nov 3rd, 2003, 02:12 PM
#1
Thread Starter
Junior Member
Calling .NET DLL from an Excel Macro??
I have a DLL that was developed under the .NET framework. It is a mathematical model used to calculate some returns. Anyways I need the ability to call the functions from within an Excel macro... The inputs for the model will come from the excel spreadsheet. The problem is I went to VB editor -> Tools -> references -> browse... then I attempt to open the .NET .DLL.... then I get the error message "Can't add reference to the specified file." If you have any experience with VBA and calling .NET DLLs any advice would be very helpful.
Thanks,
brazilnut
-
Nov 3rd, 2003, 03:34 PM
#2
You would have to convert the DLL to be COM compatible and then you can make a reference to it from within VBA. To learn how to make the DLL COM compatible please search on that topic and you should find plenty of resources. Try searching for COMInterop.
-
Nov 3rd, 2003, 03:43 PM
#3
Thread Starter
Junior Member
thanks for the help!... I will do that.
brazilnut
-
Nov 3rd, 2003, 04:20 PM
#4
Thread Starter
Junior Member
I have tried searching for COM Interop... but the only thing I have found involves making COM libraries compatible with .NET, not the other way around. I am simply trying to call a function in a .NET DLL from a VBA marco in Excel 2000. Any ideas?
brazilnut
-
Nov 3rd, 2003, 04:33 PM
#5
In the Help files for Visual Studio try searching using 'COM Interop' and you should find an article titled 'Walkthrough: Creating COM Objects with Visual Basic .NET' or you could probably even search for the title of the article to find it. It is a walkthru of how to make a COM object in VB.NET and should be exactly what you are looking for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|