Heureusement qu'y a des pros pour vérifier le travail des newbees !!!!
Heureusement qu'y a des pros pour vérifier le travail des newbees !!!!
Heureusement qu'y a des pros pour vérifier le travail des newbees !!!!
Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]=:="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End SubBonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]=:="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
077A3613-7F96-4BB6-BBC1-D17FFC2B2407@microsoft.com...
Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End Sub
Bonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
DA4288CC-CC88-447C-8E69-64684E1671CA@microsoft.com...
Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]=:="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End SubBonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Merci pour ta réponse mais quand je veux l'utiliser, j'ai une erreur à la
ligne "if [etamenu]=:="Menu actif" then exit sub".
Est-ce qu'il y a une erreur?
Bonne journée.Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End SubBonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Merci pour ta réponse mais quand je veux l'utiliser, j'ai une erreur à la
ligne "if [etamenu]=:="Menu actif" then exit sub".
Est-ce qu'il y a une erreur?
Bonne journée.
Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
077A3613-7F96-4BB6-BBC1-D17FFC2B2407@microsoft.com...
Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End Sub
Bonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
DA4288CC-CC88-447C-8E69-64684E1671CA@microsoft.com...
Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Merci pour ta réponse mais quand je veux l'utiliser, j'ai une erreur à la
ligne "if [etamenu]=:="Menu actif" then exit sub".
Est-ce qu'il y a une erreur?
Bonne journée.Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End SubBonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Oups,
Coller / copier hatif ; remplace la ligne fautive par celle ci :
if [etamenu]="Menu actif" then exit sub
le principe est de ne créer le menu que s'il n'existe pas en utilisant pour contrôle un nom du classeur
(etamenu) qui est créé à la fin de la proc en lui donnant la valeur Menu actif.
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Merci pour ta réponse mais quand je veux l'utiliser, j'ai une erreur à la
ligne "if [etamenu]=:="Menu actif" then exit sub".
Est-ce qu'il y a une erreur?
Bonne journée.Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End SubBonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Oups,
Coller / copier hatif ; remplace la ligne fautive par celle ci :
if [etamenu]="Menu actif" then exit sub
le principe est de ne créer le menu que s'il n'existe pas en utilisant pour contrôle un nom du classeur
(etamenu) qui est créé à la fin de la proc en lui donnant la valeur Menu actif.
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
0FD6FE40-B1D3-4B03-868C-1C4DBB53656A@microsoft.com...
Merci pour ta réponse mais quand je veux l'utiliser, j'ai une erreur à la
ligne "if [etamenu]=:="Menu actif" then exit sub".
Est-ce qu'il y a une erreur?
Bonne journée.
Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
077A3613-7F96-4BB6-BBC1-D17FFC2B2407@microsoft.com...
Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End Sub
Bonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" <tilivier@discussions.microsoft.com> a écrit dans le message de news:
DA4288CC-CC88-447C-8E69-64684E1671CA@microsoft.com...
Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée
Oups,
Coller / copier hatif ; remplace la ligne fautive par celle ci :
if [etamenu]="Menu actif" then exit sub
le principe est de ne créer le menu que s'il n'existe pas en utilisant pour contrôle un nom du classeur
(etamenu) qui est créé à la fin de la proc en lui donnant la valeur Menu actif.
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Merci pour ta réponse mais quand je veux l'utiliser, j'ai une erreur à la
ligne "if [etamenu]=:="Menu actif" then exit sub".
Est-ce qu'il y a une erreur?
Bonne journée.Re,
Fais l'essai de la version suivante :
Sub Ajout_Menu_Perso_2()
on error resume next
if [etamenu]="Menu actif" then exit sub
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
..Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
..Caption = "&Menu"
..FaceId = 837
..BeginGroup = False
..OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
..Caption = "Enregi&strer"
..FaceId = 3
..BeginGroup = False
..OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Données Personnelles"
..FaceId = 59
..BeginGroup = False
..OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
..Caption = "Données &Immeuble"
..FaceId = 176
..BeginGroup = False
..OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
..Caption = "&Récapitulatif"
..FaceId = 97
..BeginGroup = False
..OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
..Caption = "Statisti&ques"
..FaceId = 17
..BeginGroup = False
..OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
..Caption = "Im&pression"
..FaceId = 4
..BeginGroup = False
..OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
..Caption = "Quitter"
..FaceId = 840
..BeginGroup = False
..OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
..Caption = "Plein &écran"
..FaceId = 69
..BeginGroup = False
..OnAction = "plein_ecran"
End With
End With
ThisWorkbook.Names.Add Name:="etamenu", RefersTo:="Menu actif"
End Sub
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour Philippe
et voilà si ça peut t'aidé.
Merci
Sub Ajout_Menu_Perso()
With CommandBars(1).Controls.Add(Type:=msoControlPopup, Temporary:=True)
.Caption = "A&vanchets"
With .Controls.Add(msoControlButton)
.Caption = "&Menu"
.FaceId = 837
.BeginGroup = False
.OnAction = "Macro2"
End With
With .Controls.Add(msoControlButton)
.Caption = "Enregi&strer"
.FaceId = 3
.BeginGroup = False
.OnAction = "enregistrer"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Données Personnelles"
.FaceId = 59
.BeginGroup = False
.OnAction = "affiche_pers"
End With
With .Controls.Add(msoControlButton)
.Caption = "Données &Immeuble"
.FaceId = 176
.BeginGroup = False
.OnAction = "affiche_immeuble"
End With
With .Controls.Add(msoControlButton)
.Caption = "&Récapitulatif"
.FaceId = 97
.BeginGroup = False
.OnAction = "affiche_récapitulatif"
End With
With .Controls.Add(msoControlButton)
.Caption = "Statisti&ques"
.FaceId = 17
.BeginGroup = False
.OnAction = "affiche_stat"
End With
With .Controls.Add(msoControlButton)
.Caption = "Im&pression"
.FaceId = 4
.BeginGroup = False
.OnAction = "affiche_impress"
End With
With .Controls.Add(msoControlButton)
.Caption = "Quitter"
.FaceId = 840
.BeginGroup = False
.OnAction = "quitte"
End With
With .Controls.Add(msoControlButton)
.Caption = "Plein &écran"
.FaceId = 69
.BeginGroup = False
.OnAction = "plein_ecran"
End With
End With
End SubBonjour,
Peux tu publier ici le code concerné, il sera ainsi plus aisé d'aider (et non pluzezedede).
--
Amicales Salutations
XL 97 / 2000 / 2002
Préférez suivre facilement sur le forum :
news://msnews.microsoft.com/microsoft.public.fr.excel
(Voulez-vous vous abonner ? -> Oui)
"tilivier" a écrit dans le message de news:Bonjour,
J'ai une macro qui me créer un menu au démarrage du classeur et le problème
est que à chaque fois que j'ouvre mon classeur il me créeer un nouveau menu.
J'ai essayé de mettre un test pour vérifier si le menu existait déjà , et
s'il existe ne pas le créer, mais je n'arrive pas.
Qqn pourrait-il m'aider?
Merci d'avance et bonne journée