Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default a command button problem

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!?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default a command button problem

See your earlier thread with same question

Regards,
Peter T

"NA_AB" wrote in message
...
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!?



Reply
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
Command Button Problem albertmb Excel Discussion (Misc queries) 6 June 22nd 08 01:06 PM
Problem with command button name Jason[_9_] Excel Discussion (Misc queries) 10 October 19th 07 09:54 PM
strange command button problem David Excel Discussion (Misc queries) 0 March 20th 06 03:06 PM
Command Button Visibility Problem Ian[_9_] Excel Programming 2 February 20th 04 06:51 PM
Command Button Problem del Excel Programming 3 November 21st 03 05:13 PM


All times are GMT +1. The time now is 10:56 PM.

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

About Us

"It's about Microsoft Excel"