See your earlier thread with same question
Regards,
Peter T
"NA_AB" <(E-Mail Removed)> wrote in message
news:893B68AA-5281-4309-83A1-(E-Mail Removed)...
> 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!?
>
|