Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.interopoledde,microsoft.public.excel.programming
|
|||
|
|||
![]()
Aaron,
The first sub below will make 4 big toolbars that show the ID numbers when you hover your pointer over them. The second removes them. There are other utilities out there but I never recorded where they are, or saved those messages. HTH, Bernie MS Excel MVP Sub ShowFaceIDs() Dim NewToolbar As CommandBar Dim NewButton As CommandBarButton Dim i As Integer, IDStart As Integer, IDStop As Integer ' Delete existing FaceIds toolbar if it exists CleanUp ' Add an empty toolbar Set NewToolbar = Application.CommandBars.Add _ (Name:="FaceIds1", temporary:=True) NewToolbar.Visible = True ' Change the following values to see different FaceIDs IDStart = 1 IDStop = 250 For i = IDStart To IDStop Set NewButton = NewToolbar.Controls.Add _ (Type:=msoControlButton, ID:=2950) NewButton.FaceId = i NewButton.Caption = "FaceID = " & i Next i NewToolbar.Width = 600 ' Add an empty toolbar Set NewToolbar = Application.CommandBars.Add _ (Name:="FaceIds2", temporary:=True) NewToolbar.Visible = True ' Change the following values to see different FaceIDs IDStart = 251 IDStop = 500 For i = IDStart To IDStop Set NewButton = NewToolbar.Controls.Add _ (Type:=msoControlButton, ID:=2950) NewButton.FaceId = i NewButton.Caption = "FaceID = " & i Next i NewToolbar.Width = 600 ' Add an empty toolbar Set NewToolbar = Application.CommandBars.Add _ (Name:="FaceIds3", temporary:=True) NewToolbar.Visible = True ' Change the following values to see different FaceIDs IDStart = 501 IDStop = 750 For i = IDStart To IDStop Set NewButton = NewToolbar.Controls.Add _ (Type:=msoControlButton, ID:=2950) NewButton.FaceId = i NewButton.Caption = "FaceID = " & i Next i NewToolbar.Width = 600 ' Add an empty toolbar Set NewToolbar = Application.CommandBars.Add _ (Name:="FaceIds4", temporary:=True) NewToolbar.Visible = True ' Change the following values to see different FaceIDs IDStart = 751 IDStop = 1000 For i = IDStart To IDStop Set NewButton = NewToolbar.Controls.Add _ (Type:=msoControlButton, ID:=2950) NewButton.FaceId = i NewButton.Caption = "FaceID = " & i Next i NewToolbar.Width = 600 End Sub Sub CleanUp() On Error Resume Next Application.CommandBars("FaceIds").Delete Application.CommandBars("FaceIds1").Delete Application.CommandBars("FaceIds2").Delete Application.CommandBars("FaceIds3").Delete Application.CommandBars("FaceIds4").Delete End Sub "Aaron Queenan" wrote in message ... Thanks, Bernie. I'd suspected as much. The problem with using the clipboard is that it is common for a user to copy text to the clipboard, start Excel, then paste it. If I use the clipboard to create the toolbar icon, the user's text will be removed from the clipboard. I don't want to create a permanent toolbar, because then if the user logs into a computer without the add-in installed using a roaming profile, the toolbar will display but won't work. Do you know if there is a file where the built-in button faces are stored? I've searched the hard disk for the icons, but can't find anything that looks like the built-in button faces. I'm thinking that perhaps I can add the icon to that file and then use the next sequence number for the ..IdFace. Thanks, Aaron. "Bernie Deitrick" wrote in message ... Aaron, You can't. You have to use the clipboard to some extent to set the control's face, either by copying a picture and pasting it, or by copying another face using .CopyFace and .PasteFace. HTH, Bernie MS Excel MVP "Aaron Queenan" wrote in message ... How can I set the icon of a toolbar option or menu icon without using the builtin icons and without using the clipboard? Thanks, Aaron Queenan. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What causes custom icons in the excel standard toolbar | Excel Discussion (Misc queries) | |||
Excel 2007 Toolbar Icons | Setting up and Configuration of Excel | |||
Excel 2003 Toolbar Icons are fuzzy and out of focus | Excel Discussion (Misc queries) | |||
Excel formatting toolbar icons | Excel Discussion (Misc queries) | |||
Fax Icon on my File menu and toolbar | Excel Discussion (Misc queries) |