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
Public Sub Class_Initialize()
Set GetParentElem = New Collection
GetParentElem.Add " ", "customUI"
GetParentElem.Add " customUI ", "ribbon"
GetParentElem.Add " ribbon ", "tabs"
GetParentElem.Add " tabs ", "tab"
GetParentElem.Add " tab ", "group"
GetParentElem.Add " group ", "box"
GetParentElem.Add " group ", "buttonGroup"
GetParentElem.Add " group box menu splitButton ", "menu"
GetParentElem.Add " group ", "dynamicMenu"
GetParentElem.Add " group box buttonGroup dropDown menu ", "button"
GetParentElem.Add " group box buttongroup ", "splitButton"
GetParentElem.Add " group box ", "checkBox"
GetParentElem.Add " group box ", "radioButton"
GetParentElem.Add " group ", "comboBox"
GetParentElem.Add " group ", "dropDown"
GetParentElem.Add " group ", "gallery"
GetParentElem.Add " gallery comboBox dropDown ", "item"
GetParentElem.Add " group ", "labelControl"
GetParentElem.Add " group ", "separator"
GetParentElem.Add " menu ", "menuSeparator"
End Sub
Sub testopenfile()
fichier = Application.GetOpenFilename("Text Files (*.csv), *.csv", 1, "ouvrir un fichier")
If fichier = False Then Exit Sub
MsgBox fichier
End Sub
Sub ChoixDeFichiers() 'RyuAutodidacte 08/02/17 - GetOpenFilename à ma sauce pour Mac
If Application.OperatingSystem Like "*Macintosh*" Then
On Error Resume Next
MainPath = MacScript("POSIX path of (choose file with prompt ""Sélectionner un ou plusieurs fichiers:"" of type {""xls"",""pdf"",""xlsm"", ""csv""} with multiple selections allowed)")
'Pour la partie => {""xls"",""pdf"",""xlsm""} mettre les extensions voulues, entourées de doubles guillemets et séparées par une virgule
'Si on veut tous les fichiers mettre alors la double accolade comme suit => {}
'Si on veut ne sélectionner qu'un fichier alors retirer => with multiple selections allowed
If Err.Number > 0 Then MsgBox "Sélection annulée": Exit Sub
On Error GoTo 0
Paths = Split(Replace(MainPath, "alias ", ""), ", ") 'on récupère le tout dans un tableau de base 0 que l'on peut alors traiter
For i = LBound(Paths) To UBound(Paths)
Debug.Print Paths(i)
Next
Else
MsgBox "Mettre le code PC ici"
End If
End Sub