I figured out the ActiveX handlers
app.WorkbookOpen += _app_WorkbookOpen;
...
foreach (MsExcel.Worksheet ws in wb.Worksheets)
foreach (MsExcel.OLEObject obj in (MsExcel.OLEObjects)ws.OLEObjects())
if (obj.Object is MSForms.CommandButton button)
{
MSForms.CommandButtonEvents_ClickEventHandler handler = () =>
{
var command = button.Name;
// do something with command
}
handlers!.Add((button, handler));
button.Click += handler;
}
but I had to keep a handle on all the Button objects or they would be disposed after the first button was clicked
still - anyone know if shape events are possible though?