PC Review


Reply
Thread Tools Rate Thread

a command button problem

 
 
NA_AB
Guest
Posts: n/a
 
      9th Jan 2009
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 With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      9th Jan 2009
See your earlier thread with same question

Regards,
Peter T

"NA_AB" <(E-Mail Removed)> wrote in message
news:893B68AA-5281-4309-83A1-(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button Problem MB Microsoft Access Forms 7 15th Aug 2008 05:47 PM
Command button problem =?Utf-8?B?SmVubkJhcmQx?= Microsoft Access 2 2nd May 2006 06:30 PM
Command button problem =?Utf-8?B?S2V2aW4=?= Microsoft Access Forms 3 11th Sep 2005 09:03 PM
Command Button Problem Tom Microsoft Excel Misc 1 17th Jun 2004 06:33 PM
Command Button Problem Suzanne Wyatt Microsoft Access Form Coding 1 15th Sep 2003 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 PM.