a command button problem
See your earlier thread with same question
Regards,
Peter T
"NA_AB" wrote in message
...
Range r = Connect.myApplication.ActiveCell;
Microsoft.Office.Interop.Excel.Worksheet sht =
(Microsoft.Office.Interop.Excel.Worksheet)Connect. myApplication.ActiveSheet;
Microsoft.Office.Interop.Excel.Shape btn =
sht.Shapes.AddOLEObject("Forms.CommandButton.1",
Missing.Value,Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
sht.get_Range(r,
r).Left,sht.get_Range(r, r).Top,
sht.get_Range(r,r).Width, sht.get_Range(r, r).Height);
((MSForms.CommandButtonClass)btn.OLEFormat.Object) .Caption = "click_me";
Why is this not working?? How to get an event handler for this button!?
|