Call excel DNA Addin function On button Click event in excel

Jun 30, 2014 at 6:43 AM
Hi !,
I want to call a function add(a,b) (created with c# ), in excel sheet with button click event in excel without using any VBA. I want it in C#.

How can I do it?
or Any other options to do?

Thanks!
Coordinator
Jun 30, 2014 at 8:01 PM
You can create a macro with Excel-DNA like this:
public static void DoMyStuff()
{
...
}
And then call it from a button on the sheet by inserting a 'Form Control' and assigning "DoMyStuff" to the macro.

-Govert
Jul 4, 2014 at 7:17 AM
Thank You ! :)
Dec 11, 2014 at 12:17 AM
Hi Govert and Rushikesh1717! If You can please share the sample for VS for this thing!
Thank You!