How to call a .net assembly in VBA using COM Interop

In this scenario we want to use the .net assembly on the target machine without having access to the GAC and call it in VBA using COM Interop.

 In order to accomplish this we will need to use regasm.exe utility ( Once a class is registered, any COM client can use it as though the class were a COM class.

 Use %windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase abc.DLL which creates a codebase entry in the registry to reference the DLL. The assemblyFile argument that you specify with the /codebase option must be a strong-named assembly


Make a strong name at command prompt outside bin folder

SN -k abc.snk

Then rebuild the solution. Now give the path where the DLL is present

RegAsm.exe /tlb: abc.tlb abc.DLL

After that use RegAsm.exe /codebase abc.DLL


The following articles provide you the detailed steps on how to build COM-Addin;en-us;291392

Comments (1)

  1. Harish Kulkarni says:

    thanks for posting this soum

Skip to main content