ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CommandBar Controls (https://www.excelbanter.com/excel-programming/319667-commandbar-controls.html)

Simon Shaw[_5_]

CommandBar Controls
 
I have built menus and toolbars for my excel apps so I am familiar with
creating and setting up controls and buttons for commandbars. Now I am trying
to assign a FaceId to an msoControlButton, however this is not working. I can
assign FaceId's to buttons that I create, but not to standard ones like 'Save
As'

When I manually customize a toolbar I can add a control such as 'Save As',
then change it to default style, then select from one of the pictures. When I
try to record this in a macro I do not get any code for the FaceId change.

Ideas?

Jim Rech

CommandBar Controls
 
I don't know about recording a macro but I have no problem changing the face
id of a built-in control:

Commandbars("Standard").Controls("New").FaceId=123

Did I misunderstand the problem?
--
Jim Rech
Excel MVP

"Simon Shaw" wrote in message
...
|I have built menus and toolbars for my excel apps so I am familiar with
| creating and setting up controls and buttons for commandbars. Now I am
trying
| to assign a FaceId to an msoControlButton, however this is not working. I
can
| assign FaceId's to buttons that I create, but not to standard ones like
'Save
| As'
|
| When I manually customize a toolbar I can add a control such as 'Save As',
| then change it to default style, then select from one of the pictures.
When I
| try to record this in a macro I do not get any code for the FaceId change.
|
| Ideas?



Simon Shaw[_5_]

CommandBar Controls
 
after typing the dot after controls("New") I did not see FaceId in the drop
down. I looked at other code I had, and I had used it there so I was confused
why. Just thought I was missing something.

thanks

Simon

"Jim Rech" wrote:

I don't know about recording a macro but I have no problem changing the face
id of a built-in control:

Commandbars("Standard").Controls("New").FaceId=123

Did I misunderstand the problem?
--
Jim Rech
Excel MVP

"Simon Shaw" wrote in message
...
|I have built menus and toolbars for my excel apps so I am familiar with
| creating and setting up controls and buttons for commandbars. Now I am
trying
| to assign a FaceId to an msoControlButton, however this is not working. I
can
| assign FaceId's to buttons that I create, but not to standard ones like
'Save
| As'
|
| When I manually customize a toolbar I can add a control such as 'Save As',
| then change it to default style, then select from one of the pictures.
When I
| try to record this in a macro I do not get any code for the FaceId change.
|
| Ideas?




Dick Kusleika[_4_]

CommandBar Controls
 
Simon

It depends on how you reference the control. This:

Application.CommandBars(1).Controls("New")

will not bring up the FaceId because it's referencing the CommandBarControls
collection. That collection can contain different types of controls some of
which do not have the FaceID property. However, if you know that the
control your referencing has a FaceID property, you can use it anyway (as
Jim pointed out).

Dim cb as CommandBarButton
Dim cc as CommandBarControl

cb.FaceID = 123
cc.FaceID = 123

Since cb only references one type of control (that uses FaceID), FaceID will
show up on the popup. On the other hand cc won't show FaceID because it
could be any type of control.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Simon Shaw wrote:
after typing the dot after controls("New") I did not see FaceId in
the drop down. I looked at other code I had, and I had used it there
so I was confused why. Just thought I was missing something.

thanks

Simon

"Jim Rech" wrote:

I don't know about recording a macro but I have no problem changing
the face id of a built-in control:

Commandbars("Standard").Controls("New").FaceId=123

Did I misunderstand the problem?
--
Jim Rech
Excel MVP

"Simon Shaw" wrote in message
...
I have built menus and toolbars for my excel apps so I am familiar
with creating and setting up controls and buttons for commandbars.
Now I am trying to assign a FaceId to an msoControlButton, however
this is not working. I can assign FaceId's to buttons that I
create, but not to standard ones like 'Save As'

When I manually customize a toolbar I can add a control such as
'Save As', then change it to default style, then select from one of
the pictures. When I try to record this in a macro I do not get any
code for the FaceId change.

Ideas?





All times are GMT +1. The time now is 06:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com