Command Bar Buttons

  • Thread starter Thread starter Alec Bowman
  • Start date Start date
A

Alec Bowman

I am trying to add a custom button to the "Tools" menu bar
vi VBA. I have managed this but only on ordinary
worksheets. I would like to have the same set of custom
buttons accessible from the Chart sheet "Tools" menu as
well.

Ther is no obvious mechanism which allows a button to be
added to both Worksheet menu bars and Chart Sheet menu bars
 
I did not actually create and test a macro so I don't know for certain, but
I think you need to activate the chart sheet before adding buttons to the
menus there.

HTH, Greg
 
Ther is no obvious mechanism which allows a button to be | added to both
Worksheet menu bars and Chart Sheet menu bars

Please see my response to your earlier post. Despite having the same name
"Tools" they are different menus so each has to be addressed separately.

--
Jim Rech
Excel MVP

| I am trying to add a custom button to the "Tools" menu bar
| vi VBA. I have managed this but only on ordinary
| worksheets. I would like to have the same set of custom
| buttons accessible from the Chart sheet "Tools" menu as
| well.
|
| Ther is no obvious mechanism which allows a button to be
| added to both Worksheet menu bars and Chart Sheet menu bars
 
Hi Jim,

When recording macros for this operation, you just get the following

Application.CommandBars("Tools").Controls.Add Type:=msoControlButton,
ID:= _
23, Before:=16

No reference to the sheet
 
This abbreviated syntax will always access the Worksheet Menu Bar's Tools
menu. So to change the Chart Menu Bar you have to specify that menubar.

Recorded macros have some value but they are usually just a starting point
(with manual editing to follow). I wouldn't use them as a guide to good
programming.

--
Jim Rech
Excel MVP
| Hi Jim,
|
| When recording macros for this operation, you just get the following
|
| Application.CommandBars("Tools").Controls.Add Type:=msoControlButton,
| ID:= _
| 23, Before:=16
|
| No reference to the sheet
|
| | > >>Ther is no obvious mechanism which allows a button to be | added to
both
| > Worksheet menu bars and Chart Sheet menu bars
| >
| > Please see my response to your earlier post. Despite having the same
name
| > "Tools" they are different menus so each has to be addressed separately.
| >
| > --
| > Jim Rech
| > Excel MVP
| >
| > | > | I am trying to add a custom button to the "Tools" menu bar
| > | vi VBA. I have managed this but only on ordinary
| > | worksheets. I would like to have the same set of custom
| > | buttons accessible from the Chart sheet "Tools" menu as
| > | well.
| > |
| > | Ther is no obvious mechanism which allows a button to be
| > | added to both Worksheet menu bars and Chart Sheet menu bars
| >
| >
|
|
 
Sorry about duplicate posting. First hadn't appeared
after approx 1/2 hour so thought I hadn't posted it
properly.

Will give it a go right away.

Alec
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top