i am trying to write a DLL with Code writen in .NET / C# that can be acces in VBA Applications via COM-Interop.
Everything seems to work so far, but:

I have an Event in my C# Class that i want to acces in the VBA code:

Public Class VBATest {
public event EventHandler OnLogin;

public void Test() {
if (this.OnLogin != null)
this.OnLogin(this, EventArgs.Empty);

Now i want to add an event Listener in my VBA Code to the OnLoginEvent.

Is there a way to do this or are C# like Events are not Supported to be use over Com-Interop in VBA

BTW: If someone knows any tutorials about C#/.Net -> Com-Interop -> VBA (Excel), let me know

Thank you very much for any Help!

Re: Using C# Events over COm-Interop in VBA


Check out this page: http://huntjason.spaces.live.com/blog/cns!9D2E96F2AA6AE85F!119.entry

I wanted to do exactly what you wanted to do. This solution worked fine for me.