OVH Cloud OVH Cloud

Commandbars

2 réponses
Avatar
tilivier
Bonjour,
je veux faire apparaître une barre d'outil à l'ouverture de mon classeur et
je n'arrive pas à imsérer plus de 3 boutons. quelqu'un aurait-il un
explication

Sub NewBar()
Application.CommandBars.Add(Name:="aaaa", Position:=msoBarTop,
temporary:=True).Visible = True
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=837, Before:=1
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=3, Before:=2
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=59, Before:=3
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=97, Before:=4
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=17, Before:=5
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=4, Before:=6
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=840, Before:=7
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=359, Before:=8
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=176, Before:=9

End Sub



Merci

2 réponses

Avatar
MichDenis
Bonjour tilivier,

Tu veux bien me dire à quelle commande du menu ou d'une barre d'outils correspond le ID: ou le ID:— et probablement tous les
autres qui ne fonctionnnent pas ?

Sur les barres "Built-In" d'excel 2003, ces numéros ID n'existent pas ... je crois que c'est une raison suffisante pour que ta macro
se plange ... !


Salutations!



"tilivier" a écrit dans le message de news:

Bonjour,
je veux faire apparaître une barre d'outil à l'ouverture de mon classeur et
je n'arrive pas à imsérer plus de 3 boutons. quelqu'un aurait-il un
explication

Sub NewBar()
Application.CommandBars.Add(Name:="aaaa", Position:=msoBarTop,
temporary:=True).Visible = True
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:ƒ7, Before:=1
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=3, Before:=2
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:Y, Before:=3
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:—, Before:=4
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:, Before:=5
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=4, Before:=6
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:„0, Before:=7
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:59, Before:=8
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:6, Before:=9

End Sub



Merci
Avatar
tilivier
Merci MichDenis,

En fait j'ai fait une énaurme confusion entre ID et FaceId. je devais dormir
au moment où j'ai écrit ça. En tout cas merci beaucoup.


Bonjour tilivier,

Tu veux bien me dire à quelle commande du menu ou d'une barre d'outils correspond le ID: ou le ID:— et probablement tous les
autres qui ne fonctionnnent pas ?

Sur les barres "Built-In" d'excel 2003, ces numéros ID n'existent pas ... je crois que c'est une raison suffisante pour que ta macro
se plange ... !


Salutations!



"tilivier" a écrit dans le message de news:

Bonjour,
je veux faire apparaître une barre d'outil à l'ouverture de mon classeur et
je n'arrive pas à imsérer plus de 3 boutons. quelqu'un aurait-il un
explication

Sub NewBar()
Application.CommandBars.Add(Name:="aaaa", Position:=msoBarTop,
temporary:=True).Visible = True
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:ƒ7, Before:=1
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=3, Before:=2
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:Y, Before:=3
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:—, Before:=4
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:, Before:=5
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:=4, Before:=6
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:„0, Before:=7
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:59, Before:=8
Application.CommandBars("aaaa").Controls.Add Type:=msoControlButton, ID _
:6, Before:=9

End Sub



Merci