I'm beginning to work with VSTO and I've a very simple question to ask about controls placed in documents.
As you can see in the attached code, I've added a button on a worksheet, but I cannot handle the event in my function BtnTest_Click(), because Excel is looking for a VBA macro called "BtnTest_Click" in my workbook.
Is there an other way to work with controls in documents?
Am I forced to write a macro in VBA?
private void CreateButton()
Excel.Worksheet sheet = Application.ActiveSheet as Excel.Worksheet;
Excel.Button btn = (sheet.Buttons(oMissing) as Excel.Buttons).Add(10, 10, 50, 20);
btn.Caption = "Test";
private void BtnTest_Click()