Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Commandbar Objects 2

Status
Not open for further replies.

HorseGoose

Programmer
Apr 24, 2003
40
GB
I was getting tired of not finding the proper ids and names for the commandbar objects when I was referencing them in my code so I wrote this. It works OK not pretty but it maybe of use for someone. It outputs all commandbar controls menu name, control name and id to a blank sheet.

Probably of no use to anyone.

sub menuindex()
Row = 1
Range("a" & Row) = "Bar Name"
Range("b" & Row) = "Control ID"
Range("c" & Row) = "Control Caption"
For Each Bar In CommandBars
For Each ctl In Bar.Controls
Row = Row + 1
Range("a" & Row) = CStr(Bar.Name)
Range("b" & Row) = CStr(ctl.ID)
Range("c" & Row) = CStr(ctl.Caption)
Next ctl
Next Bar
End Sub
 
Nice - I'm sure this'll be of help to a lot of people so have a star !!

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top