ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing .NET DLL built for COM in VBA (https://www.excelbanter.com/excel-programming/414554-referencing-net-dll-built-com-vba.html)

J. Caplan[_2_]

Referencing .NET DLL built for COM in VBA
 
I have a DLL that I wrote in .Net (VS 2005) and built for Com Interop. I can
make a reference to the DLL inside of my Excel 2003 VBA code by choosing
Tools-References from the VBA editor. I can create an instance of the
object and everything works fine.

The problem I am having is when I take this DLL and put it on a different
machine along with the XLA code that I created above. I ran Regasm.exe
/Codebase <Full path of DLL name for the .NET Com Interop DLL. The Excel
Add-in on this machine fails to find the DLL. If I look in the
Tools-References in Excel VBA on this machine, it shows that the DLL is
missing and wants to find it at the same path that it was on my machine.

I even cleaned up the DLL on my machine and just copied the DLL to my
machine and ran Regasm on it. Now I can't reference the DLL on my machine.
Only when I build through Visual Studio on my machine can I see the reference
from VBA.

What else is Visual Studio doing to register this DLL besides just running
Regasm?



All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com