LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Add button to worksheet cell

Hi,

I am able to add a button in an excel worksheet cell in C# code. Now I want
to handle its click event in the C# itself.

Here is the code I have tried:

Excel.Buttons buttons = activeSheet.Buttons(System.Reflection.Missing.Valu e)
as Excel.Buttons;
Excel.Button button = null;
button = buttons.Add(5, 5, 100, 20);
button.Caption = "Trend Chart";

Now, there is one property of button class named ".OnAction". I guess we can
only define the macro name in this.
Kindly let me know how to handle its click event in C# instead of calling
macro?

Thanks,
Sunil

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
go to worksheet on button name Northern Dave New Users to Excel 1 November 4th 08 12:04 PM
Problem: vba code for creating a button to save worksheet as Cell caldog Excel Programming 7 September 26th 06 10:04 PM
How do I code VBA to hit button on a different worksheet? [email protected] Excel Programming 5 August 8th 06 09:39 PM
print different worksheet by pressing visible button on worksheet Confused Excel Worksheet Functions 2 June 13th 05 02:22 PM
Find button on worksheet Al[_7_] Excel Programming 2 September 9th 03 09:04 PM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"