PDA

View Full Version : How to Create several buttons dynamically in my own Ms-Excel Plugin DYnamically



Archanasingh
12-06-2011, 11:09 PM
hey,

I am developing my OWN Excel plugin in VS.NET C#. I have created a ribbon in my plugin in which i have created Ribbonbutton.

What i wanted to do is i want to create a new button every time whenever i click on That particular button.

That buttons i want to make moveable also.

After lots of googling through i found a code snippet..like
Worksheet worksheet = Globals.Factory.GetVstoObject(
Globals.ThisAddIn.Application.ActiveWorkbook.ActiveSheet);
worksheet.Controls.AddButton(worksheet.Range["A1"], "objButton" + intCount.ToString());

This will generate the buttons but they will not be editable . I mean i also can not handle their events?

So i again search for and found OLEOBJECTS but i do not know how to add buttons dynamically in active worksheet that will further moveable also.

Please help me ..how can i do this...
No body is helping me out... i need C# code please
please help....
or mail me at
archana.jain@claricetechnologies.com


please guide me