desactivation des barres d'outil

P

Philboy

Guest
Bonjour a tout le forum

voila mon problem :

j'ai un code que je met dans "thisworkbook",il serre a tout desactiver, quand je dis tout, c'est tout. mais j'aimerai le modifier pour laisser une seul barre d'outil (personnalisee) , le voici :



Private Sub Workbook_Activate()
Application.CommandBars(1).Enabled = False
Dim CmdB As CommandBar
For Each CmdB In Application.CommandBars
CmdB.Enabled = False



Next CmdB

End Sub


Private Sub Workbook_Deactivate()
Application.CommandBars(1).Enabled = True

Dim CmdB As CommandBar
For Each CmdB In Application.CommandBars
CmdB.Enabled = True
Next CmdB
End Sub


Merci pour vos lumieres
 
W

Wilfried

Guest
Salut PhilBoy

Pour ton problème :

aprés ta boucle tu peu insèrer :

commandbars("personnalisee").enable=false

Attention si tu ne veu pas avoir un code erreur dans ta réactivation :

dans ta boucle de réactivation
if commandbars("personnalisee").enable=false then next cmdb

voila je pense que cela doit marché (je ne l'ai pas encore testé)

A++
Wilfried ;-)
 

Discussions similaires

Statistiques des forums

Discussions
312 493
Messages
2 088 955
Membres
103 989
dernier inscrit
jralonso