Sub Add_AddIn() 'version Mac (peut être PC aussi pouvez vous confirmer SVP)
Dim addInPath As String
addInPath = "MonChemin/TEST.xlam"
AddIns.Add addInPath
AddIns("TEST").Installed = True '
End Sub
With XbuttoN
.setattribute "id", "x1"
<mso:button label="CORR FOLIOS" imageMso="Clear" visible="true" onAction="C:\Users\NomDuUsers\Documents\MACROS COMPLEMENTS\MACROS INDEX\INDEX MACROS V2.xlam!CorrComaDashSpace" idQ="x1:C:_Users_NomDuUsers_Documents_MACROS_COMPLEMENTS_MACROS_INDEX_INDEX_MACROS_V2.xlam_CorrComaDashSpace_0_114C4B8"/>
-<mso:tab insertBeforeQ="mso:TabBackgroundRemoval" label="INDEX" id="mso_c1.11178E9">
Sub testUIUI()
Dim XmLdoC, TabS, XtaB, grouP, XbuttoN, Nom$, I&, TheUserProfil As String
TheUserProfil = Environ("userprofile")
Set XmLdoC = createXMLbase
Set TabS = XmLdoC.getelementsbytagname("tabs")(0)
'<group id="Group_1" label="GROUPETEST" imageMso="FormulaMoreFunctionsMenu" autoScale="true">
'creation de l'onglet
Set XtaB = TabS.appendchild(XmLdoC.createelement("tab"))
With XtaB: .setattribute "id", "tab1": .setattribute "label", "INDEX": End With
'creation du premier groupe
Set grouP = XtaB.appendchild(XmLdoC.createelement("group"))
With grouP: .setattribute "id", "group1": .setattribute "label", "MACROS": End With
'<button id="x1" label="test1" imageMso="ListMacros" onAction="test1" visible="true"/>
Set XbuttoN = grouP.appendchild(XmLdoC.createelement("button"))
With XbuttoN
.setattribute "id", "x1"
.setattribute "label", "CORR FOLIOS"
.setattribute "imageMso", "Clear"
.setattribute "onAction", TheUserProfil & "\Documents\MACROS COMPLEMENTS\MACROS INDEX\INDEX MACROS V2.xlam!CorrComaDashSpace"
.setattribute "visible", "true"
.setattribute "size", "large"
End With
'<button id="x2" label="test2" imageMso="ListMacros" onAction="test2" visible="true"/>
Set XbuttoN = grouP.appendchild(XmLdoC.createelement("button"))
With XbuttoN
.setattribute "id", "x2"
.setattribute "label", "FAMILIES"
.setattribute "imageMso", "ListMacros"
.setattribute "onAction", TheUserProfil & "\Documents\MACROS COMPLEMENTS\MACROS INDEX\INDEX MACROS V2.xlam!Family"
.setattribute "visible", "true"
.setattribute "size", "large"
End With
'<button id="x3" label="test3" imageMso="ListMacros" onAction="test3" visible="true"/>
Set XbuttoN = grouP.appendchild(XmLdoC.createelement("button"))
With XbuttoN
.setattribute "id", "x3"
.setattribute "label", "CHANGE FOLIOS"
.setattribute "imageMso", "TableSelect"
.setattribute "onAction", TheUserProfil & "\Documents\MACROS COMPLEMENTS\MACROS INDEX\INDEX MACROS V2.xlam!ParamChangeFolios"
.setattribute "visible", "true"
.setattribute "size", "large"
End With
'<button id="x4" label="test4" imageMso="ListMacros" onAction="test4" visible="true"/>
Set XbuttoN = grouP.appendchild(XmLdoC.createelement("button"))
With XbuttoN
.setattribute "id", "x4"
.setattribute "label", "CHANGE FOLIOS BY SELECTION"
.setattribute "imageMso", "Bullets"
.setattribute "onAction", TheUserProfil & "Documents\MACROS COMPLEMENTS\MACROS INDEX\INDEX MACROS V2.xlam!SelectParaChangeFolios"
.setattribute "visible", "true"
.setattribute "size", "large"
End With
Nom = Environ("userprofile") & "\AppData\Local\Microsoft\Office\Excel.officeUI"
I = FreeFile
Open Nom For Output As #I: Print #I, XmLdoC.XML: Close #I
End Sub
'creation de l'onglet
Set xtab = tabs.appendchild(xmldoc.createelement("tab"))
With xtab: .setattribute "id", "tab1": .setattribute "label", "mon premier onglet":
.setattribute "insertBeforeQ", "TabBackgroundRemoval"
End With
… oublis les "mso:" ,"IdQ" etc
réponse en page 2 post #21 les dernière lignes et en rouge en plus- Je n'ai pas encore la maitrise (la meilleurs solution que j'ai trouvé sur le net) de ce que tu m'as fourni,
mais je suis tombé sur un thread sur le net, qui parle (si j'ai bien compris …) de mettre le ruban directement sur le xlam …
- Qu'en penses tu (judicieux ou pas) ?
- Est ce faisable ? (car 1ère solution que tu m'avais donné : enregistrer le ruban dans le xml :
me convient pas => xlsx dont j'ai besoin)- Si oui comment ?
onglet:"INDEX" ( le nom de l'onglet)
le groupe:"MACROS"( le nom du groupe)
bouton1:
label:"CORR FOLIOS"
imagemso:"clear"
on action:"CorrComaDashSpace"
bouton2
label:"FAMILIES"
imagemso:"ListMacros"
onaction:"Family"
bouton3
label:"CHANGE FOLIOS"
imagemso:"TableSelect"
onaction:"ParamChangeFolios"
bouton4
label:"CHANGE FOLIOS BY SELECTION"
imagemso:"Bullets"
onaction:"SelectParaChangeFolios"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<customUI xxmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="tab-0" label="INDEX">
<group id="group-0" label="MACROS">
<button id="button_0" onAction="CORRCOMMDASHSPACE" label="CORR FOLIOS" imageMso="ClearAll" size="large"/>
<button id="button_1" label="FAMILY" onAction="family" imageMso="LabelInsert" size="large"/>
<button id="button_2" label="CHANGE FOLIOS" onAction="ParamChangeFolios" imageMso="TableSelectVisibleCells" size="large"/>
<button id="button_3" label="CHANGE FOLIOS BY SELECTION" onAction="CHANGE_FOLIOS_BY_SELECTION_click" imageMso="BulletsAndNumberingBulletsDialog" size="large"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Re,alors d'après ce que je comprends de ton xml
est ce bien ça
VB:onglet:"INDEX" ( le nom de l'onglet) le groupe:"MACROS"( le nom du groupe) bouton1: label:"CORR FOLIOS" imagemso:"clear" on action:"CorrComaDashSpace" bouton2 label:"FAMILIES" imagemso:"ListMacros" onaction:"Family" bouton3 label:"CHANGE FOLIOS" imagemso:"TableSelect" onaction:"ParamChangeFolios" bouton4 label:"CHANGE FOLIOS BY SELECTION" imagemso:"Bullets" onaction:"SelectParaChangeFolios"
J'utilise SharePoint au taf et les macros fonctionnentRyuAutodidacte à dit:Étant donné que le fichier doit être partagé via SharePoint (les macros ne marchent pas via SharePoint), je ne peux le fournir en xlsm
Retu es sur Mac la non ?
Hello @Staple1600,J'utilise SharePoint au taf et les macros fonctionnent