Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding "Add-Ins..." control to custom tooolbar

Windows XP Pro SP2
Excel 2002 SP3

I have an AddIn that I created that creates a toolbar when the AddIn is
turned on, and I want to add the "Add-Ins..." control from the Tools menu to
this custom toolbar. I know I can get to the "Add-Ins..." control by

Dim MyCtrl as CommandBarsControl
Set MyCtrl = Application.CommandBars("Tools").Controls(15)

The problem arises when I try to copy to my custom toolbar (named
"MyToolbar") as I REALLY want to copy MyCtrl to a CommandBarPopup that is on
"MyToolbar".

So this is what I have

MyCtrl, the "Add-Ins..." control from the Tools menu
MyToolbar, created programmatically
MyMenu, a CommandBarPopup on MyToolbar

Any ideas?

Thanks!!

-gk-



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Adding "Add-Ins..." control to custom tooolbar


gk,
You can use the "Copy" method to copy an existing control to a toolbar...

Sub PutHerThere()
Dim MyCtrl As CommandBarControl
Dim MyToolbar As CommandBar
Set MyCtrl = Application.CommandBars.FindControl(ID:=943) 'Add-Ins control
Set MyToolbar = Application.CommandBars.Add("TempBar", msoBarFloating, False, True)

MyCtrl.Copy bar:=MyToolbar
MyToolbar.Visible = True

Set MyCtrl = Nothing
Set MyToolbar = Nothing
End Sub

'Get rid of it...
Sub Goodbye()
Application.CommandBars("TempBar").Delete
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Sandusky"
wrote in message
Windows XP Pro SP2
Excel 2002 SP3
I have an AddIn that I created that creates a toolbar when the AddIn is
turned on, and I want to add the "Add-Ins..." control from the Tools menu to
this custom toolbar. I know I can get to the "Add-Ins..." control by

Dim MyCtrl as CommandBarsControl
Set MyCtrl = Application.CommandBars("Tools").Controls(15)

The problem arises when I try to copy to my custom toolbar (named
"MyToolbar") as I REALLY want to copy MyCtrl to a CommandBarPopup that is on
"MyToolbar".
So this is what I have

MyCtrl, the "Add-Ins..." control from the Tools menu
MyToolbar, created programmatically
MyMenu, a CommandBarPopup on MyToolbar

Any ideas?
Thanks!!
-gk-



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
Adding data only if adjacent to cell labeled "male"/"female" lovesrubbaducky Excel Worksheet Functions 1 November 23rd 09 05:49 PM
"Control" plus "click" doesn't allow me to select multiple cells Ken Cooke New Users to Excel 0 September 25th 06 04:46 PM
Scroll Bar missing "Control" tab in "Format Properties" dialog box Peter Rooney Excel Discussion (Misc queries) 5 August 24th 06 05:36 PM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM
adding items to combobox using "Tag" control to limit bob cochran Excel Programming 5 September 10th 03 05:21 PM


All times are GMT +1. The time now is 04:50 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"