Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default msoControlActiveX

I am writing an add-in for excel that should a buttons to a commandBar.
Since Excel doesn't allow me to add a msoControlButtonDropdown, I have tried
going the ActiveX control route(msoControlActiveX).

However, when I add my activeX control to the commandBar the size is totally
wrong, and I can't resize it. Any ideas?

I am using Office 2003. Here's the code that adds the control to the
"standard" commandBar:

object omissing = System.Reflection.Missing.Value;
MyButton =
(Office.CommandBarControl)oStandardBar.Controls.Ad d(Microsoft.Office.Core.MsoControlType.msoControlA ctiveX,
omissing, omissing, omissing, omissing);
MyButton.Caption = "My Custom Button5";
Microsoft.Office.Core._CommandBarActiveX activeXControl = MyButton as
Microsoft.Office.Core._CommandBarActiveX;
activeXControl.ControlCLSID = "{830C63B8-6C8A-4b64-99F2-237319703D8F}";

MyButton.Width = 32;
MyButton.Height = 32;


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



All times are GMT +1. The time now is 05:32 PM.

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"