Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I would like to call a com component (i.e a dll which is created in .net) from another program i.e. an excel VBA.

 

How is it possible to create a dll in .net?

Thanks

Farshad
  • *Experts*
Posted

A DLL which is created in .NET is not a COM component, it is a .NET component, and as such is not directly callable from VBA. You need to create a new Class Library project, give the class the ComClass attribute, specify GUIDs using the GUID Generator, and tell the compiler to mark the DLL for COM Interop. When all is said and done, you will have two files: a standard .NET DLL, and a TLB TypeLib that can be referenced by VB. You won't really have a COM component, just a wrapper to a .NET component which will still require the .NET framework.

 

The process takes a bit of time, and it is fully documented in a MSDN. Just search for COM components in your MSDN and you should find something about creating them.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...