Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create the VBA code in a separate COM dll, and then you can use COM interop to call from C#</p> <p>For instance, see SO question: <a href="https://stackoverflow.com/questions/1037786/using-a-com-dll-from-c-without-a-type-library">Using a COM dll from C# without a type library</a>.</p> <blockquote> <p><a href="http://msdn.microsoft.com/en-us/library/ms173185.aspx" rel="nofollow noreferrer"><strong>Exposing COM Components to C#</strong></a></p> <p>You can consume a COM component from a C# project. The general steps are as follows:</p> <ol> <li><p>Locate a COM component to use and register it. Use regsvr32.exe to register or un–register a COM DLL.</p></li> <li><p>Add to the project a reference to the COM component or type library.</p></li> </ol> <p>When you add the reference, Visual Studio uses the Type Library Importer (Tlbimp.exe), which takes a type library as input, to output a .NET Framework interop assembly. The assembly, also named a runtime callable wrapper (RCW), contains managed classes and interfaces that wrap the COM classes and interfaces that are in the type library. Visual Studio adds to the project a reference to the generated assembly.</p> <ol start="3"> <li><p>Create an instance of a class that is defined in the RCW. This, in turn, creates an instance of the COM object.</p></li> <li><p>Use the object just as you use other managed objects. When the object is reclaimed by garbage collection, the instance of the COM object is also released from memory.</p></li> </ol> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload