to add a button to the active excel cell! here's the way!
- From: NA_AB <NAAB@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 9 Jan 2009 01:41:01 -0800
hey ppl n hi peter! at last, found a way out.
Range r = Connect.myApplication.ActiveCell;
Microsoft.Office.Interop.Excel.Work*** the*** =
(Microsoft.Office.Interop.Excel.Worksheet)Connect.myApplication.Worksheets.get_Item(1);
the***.Shapes.AddOLEObject("Forms.CommandButton.1",
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
"click_me", the***.get_Range(r, r).Left,the***.get_Range(r,
r).Top, the***.get_Range(r,
r).Width, the***.get_Range(r, r).Height);
Requires you to add MSForms 2.0, your addin should have a reference to
MSForms object library and use as MSForms.CommandButton.
.
- Follow-Ups:
- Prev by Date: VBA macro in Excel
- Next by Date: Macro not returning correct data
- Previous by thread: VBA macro in Excel
- Next by thread: RE: to add a button to the active excel cell! here's the way!
- Index(es):