I am not sure about the Excel Object Model. I want to have a C# library I can call a C# function, which i have done with help of below article. http://blogs.msdn.com/eric\_carter/archive/2004/12/01/273127.aspx I also want to have setup callback, event in the C# space and i can get the callback/event inside Excel. eg. i have an event like below, i can get the event with AlarmEventHandler. I just want to have such event happening in Excel. (below code copied from msdn)
public class AlarmClock
{
public event AlarmEventHandler Alarm;
protected virtual void OnAlarm(AlarmEventArgs e)
{
if (Alarm != null)
{
// Invokes the delegates.
Alarm(this, e);
}
}
}
public static void Main (string[] args)
{
// Instantiates the event receiver.
WakeMeUp w= new WakeMeUp();
// Instantiates the event source.
AlarmClock clock = new AlarmClock();
// I want to able to get this event inside Excel VBA space.
clock.Alarm += new AlarmEventHandler(w.AlarmRang);
clock.Start();
}