View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default a button on an excel cell

I don't know the C# syntax but in VB/A -

Dim ole as Excel.OLEObject
With xlApp.ActiveCell
Set ole = xlApp.ActiveSheet.OLEObjects.Add("Forms.CommandBut ton.1", _
Left:=.Left, Top:=.Top, Width:=115#, Height:=24#)
End With
ole.Visible = True

' trap the button's events in a WithEvents class
Set c = New clsBtnEvents
Set c.btn = ole.Object

Regards,
Peter T


"NA_AB" wrote in message
...

how to generate the command button on the active cell?!?!