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
START
NOUVEAU PROJET
RESET
ENREGISTRER LE PROJET
REPRENDRE UN PROJET
APERÇU DU XML
ENREGISTRER LE XML
CRÉATION DU FICHIER EXCEL
LES CONTAINERS
ADD TAB
ADD GROUP
ADD BOX
ADD BUTTONGROUP
ADD GALLERY
CONTROL LISTE ET MENU
ADD MENU
ADD DYNAMIC MENU
ADD DROPDOWN
ADD COMBOBOX
ADD BUTTON
ADD TOGGLEBUTTON
ADD SPLITBUTTON
ADD ITEM
ADD EDITBOX
ADD CHECKBOX
ADD SEPARATEUR
ADD MENU SEPARATEUR
ADD LABBELCONTROL
file -I /Users/UserPro/Downloads/001\ Ribbon/customUi.xml
Le résultat ci-dessous
/Users/UserPro/Downloads/001 Ribbon/customUi.xml: text/xml; charset=us-ascii
'patricktoulon
'variable
Public v(1 To 3) As Boolean
Public myRibbon As IRibbonUI
'Callback for customUI.onLoad
Sub CustomUIOnLoad(ribbon As IRibbonUI)
Set myRibbon = ribbon
End Sub
'Callback for button_1 onAction
Sub button_1_Click(control As IRibbonControl)
v(1) = True: v(2) = False: v(3) = False
myRibbon.Invalidate
End Sub
'Callback for button_2 onAction
Sub button_2_Click(control As IRibbonControl)
v(1) = False: v(2) = True: v(3) = False
myRibbon.Invalidate
End Sub
'Callback for button_3 onAction
Sub button_3_Click(control As IRibbonControl)
v(1) = False: v(2) = False: v(3) = True
myRibbon.Invalidate
End Sub
'Callback for group_2 getVisible
Sub group_2_Getvisible(control As IRibbonControl, ByRef returnedVal)
returnedVal = v(1)
End Sub
'Callback for group_3 getVisible
Sub group_3_Getvisible(control As IRibbonControl, ByRef returnedVal)
returnedVal = v(2)
End Sub
'Callback for group_4 getVisible
Sub group_4_Getvisible(control As IRibbonControl, ByRef returnedVal)
returnedVal = v(3)
End Sub
'Callback for button_4 onAction
Sub button_4_Click(control As IRibbonControl)
End Sub
'Callback for button_5 onAction
Sub button_5_Click(control As IRibbonControl)
End Sub
'Callback for button_6 onAction
Sub button_6_Click(control As IRibbonControl)
End Sub
'Callback for button_7 onAction
Sub button_7_Click(control As IRibbonControl)
End Sub
'Callback for button_8 onAction
Sub button_8_Click(control As IRibbonControl)
End Sub
'Callback for button_9 onAction
Sub button_9_Click(control As IRibbonControl)
End Sub
'Callback for button_10 onAction
Sub button_10_Click(control As IRibbonControl)
End Sub
'Callback for button_11 onAction
Sub button_11_Click(control As IRibbonControl)
End Sub
'Callback for button_12 onAction
Sub button_12_Click(control As IRibbonControl)
End Sub
'Callback for button_13 onAction
Sub button_13_Click(control As IRibbonControl)
End Sub
'Callback for button_14 onAction
Sub button_14_Click(control As IRibbonControl)
End Sub
'Callback for button_15 onAction
Sub button_15_Click(control As IRibbonControl)
End Sub
'Callback for button_16 onAction
Sub button_16_Click(control As IRibbonControl)
End Sub
Sub test()
Dim myfile, Cod
myfile = "C:\Users\patricktoulon\Desktop\MaccustomUI.xml"
Cod = "<customUI>" & vbCrLf & _
vbTab & "<ribbon>" & vbCrLf & _
vbTab & vbTab & "<tabs>" & vbCrLf & _
vbTab & vbTab & vbTab & "<tab>" & vbCrLf & _
vbTab & vbTab & vbTab & "</tab>" & vbCrLf & _
vbTab & vbTab & "</tabs>" & vbCrLf & _
vbTab & "</ribbon>" & vbCrLf & _
"</customUI>"
SaveXmlFileUTF_8 Cod, myfile
End Sub
Function SaveXmlFileUTF_8(Cod, myfile)
Dim BOM(0 To 2) As Byte 'EF BB BF
BOM(0) = &HEF: BOM(1) = &HBB: BOM(2) = &HBF
If Dir(myfile) <> "" Then Kill myfile
'création du fichier xml en utf-8
Open myfile For Binary Access Write As #1: Put #1, 1, BOM: Close #1
'on le réouvre pour y mettre enfin le code
Open myfile For Append As #1: Print #1, Cod: Close #1
End Function
Woaw woaw woawbon ben c'est bon pour moi
Regarde la pièce jointe 1199877VB:Sub test() Dim myfile, Cod myfile = "C:\Users\patricktoulon\Desktop\MaccustomUI.xml" Cod = "<customUI>" & vbCrLf & _ vbTab & "<ribbon>" & vbCrLf & _ vbTab & vbTab & "<tabs>" & vbCrLf & _ vbTab & vbTab & vbTab & "<tab>" & vbCrLf & _ vbTab & vbTab & vbTab & "</tab>" & vbCrLf & _ vbTab & vbTab & "</tabs>" & vbCrLf & _ vbTab & "</ribbon>" & vbCrLf & _ "</customUI>" SaveXmlFileUTF_8 Cod, myfile End Sub Function SaveXmlFileUTF_8(Cod, myfile) Dim BOM(0 To 2) As Byte 'EF BB BF BOM(0) = &HEF: BOM(1) = &HBB: BOM(2) = &HBF If Dir(myfile) <> "" Then Kill myfile 'création du fichier xml en utf-8 Open myfile For Binary Access Write As #1: Put #1, 1, BOM: Close #1 'on le réouvre pour y mettre enfin le code Open myfile For Append As #1: Print #1, Cod: Close #1 End Function
il faudra changer le #1 pour un freefile (si Freefile ca marche sur mac)
voila voila