Boostez vos compétences Excel avec notre communauté !
Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="CustomUIOnLoad"
xmlns:pat="Patrickian">
<!--CreatorRibbonX ImageMso 2025 Version 8.0 by patricktoulon developed BY patricktoulon-->
<!--project Ribbon name :projet idQ-->
<!--edition : 28/11/2025 with ="CreatorRibbonX ImageMso 2025 Version 8,0 developed BY Patrick Verne"-->
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabDeveloper" visible="true">
<group idQ="pat:taratata" imageMso="ReadingModeMini">
<button id="button_1" imageMso="MacroConditions" label="toto" size="large" onAction="toto_Click"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="CustomUIOnLoad"
xmlns:pat="Patrickian">
<!--CreatorRibbonX ImageMso 2025 Version 8.0 by patricktoulon developed BY patricktoulon-->
<!--project Ribbon name :projet idQ-->
<!--edition : 28/11/2025 with ="CreatorRibbonX ImageMso 2025 Version 8,0 developed BY Patrick Verne"-->
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabDeveloper" visible="true">
<group idQ="pat:taratata" imageMso="ReadingModeMini">
<button id="button_475878" imageMso="HappyFace" label="titi" size="large" onAction="toto_Click"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
'procedure {getImage} du button[ID:''button_1'' ]'dans le parent [paletteXone'' Label:''Palette couleurs'']
'valeur par defaut
Sub getImage(control As IRibbonControl, ByRef image)
Set image = ShapeToIPicture(CreateTemporaryShape(msoShapeRectangle, control), IconSize:="small")
End Sub
'------------------------
'Create a temporary Shape
'------------------------
Function CreateTemporaryShape(MsoAutoShapeType As Integer, control As IRibbonControl) As Shape
Dim Shape As Shape
Dim WorkbookSavedAtCallTime As Boolean
WorkbookSavedAtCallTime = ActiveWorkbook.Saved
Set Shape = ActiveSheet.Shapes.AddShape(MsoAutoShapeType, 0, 0, 32, 32)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI azerty="http://schemas.microsoft.com/office/2009/07/customui" onLoad="CustomUIOnLoad" loadImage="Ribbon_loadImage">
<!--CreatorRibbonX ImageMso 2025 Version 6.9 developed BY patricktoulon-->
<!--project Ribbon name :Coefficiences-->
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabHome" visible="true">
<group id="paletteXone" label="Palette couleurs">
<button id="button_1" screentip="rouge" image="255" tag="255" onAction="ChangeColorCell"/>
<button id="button_2" screentip="jaune" image="65535" tag="65635" onAction="ChangeColorCell"/>
<button id="button_3" image="65280" screentip="vert" tag="65280" onAction="ChangeColorCell"/>
<button id="button_4" image="15174705" screentip="bleu" tag="15174705" onAction="ChangeColorCell"/>
<button id="button_5" image="14438496" tag="14438496" onAction="ChangeColorCell" screentip="Violet"/>
<button id="button_6" image="2329968" screentip="Orange" tag="2329968" onAction="ChangeColorCell"/>
<button id="button_7" image="2329968" screentip="Olive" tag="2329968" onAction="ChangeColorCell"/>
<button id="button_8" image="13811710" screentip="Rose" tag="13811710" onAction="ChangeColorCell"/>
<button id="button_9" image="10395294" screentip="Gris" tag="10395294" onAction="ChangeColorCell"/>
<button id="button_10" image="16645413" screentip="Turquoise" tag="16645413" onAction="ChangeColorCell"/>
</group>
</tab>
<tab id="tab_1" label="trucbidulechouette">
<group id="group_0" label="aaaaaa" imageMso="CreateDocumentLibrary" autoScale="true">
<button id="button_11" label="bbbbbbbbbb PDF" imageMso="FileEmailAsPdfEmailAttachment" size="large" onAction="Integrer_un_document_PDF_Click"/>
<separator id="separator_3"/>
<button id="button_12" label="Iccccccccautre" imageMso="GroupDocumentsNew" size="large" onAction="Integrer_un_document_autre_Click"/>
<separator id="separator_2"/>
<button id="button_13" size="large" label="cccccccccccneetégrés" imageMso="ContactDelete" onAction="Supprimer_tous_les_documents_integres_Click"/>
<separator id="separator_1"/>
<button id="button_14" size="large" label="fffffffffé du lien" imageMso="AdpStoredProcedureQueryDelete" onAction="Supprimer_le_document_integre_du_lien_Click"/>
</group>
<group id="group_1" label="fffffffffangements" imageMso="ChangeBinding">
<button id="button_15" size="large" label="ffffffffff à revue client" imageMso="GroupAccessibleAuthoringReview" onAction="Preparer_classeur_a_revue_client_Click"/>
</group>
<group id="group_2" label="ffffffff classeur" autoScale="true">
<button id="button_16" size="large" label="fffffffumérotés" imageMso="CodeHyperlinkForward" onAction="Renvois_numerotes_Click"/>
<separator id="separator_5"/>
<button id="button_17" label="ffffff classeur" size="large" imageMso="EntityViewSummary" onAction="Sommaire_classeur_Click"/>
<separator id="separator_4"/>
<button id="button_18" label="Liens fffffff cellules" size="large" imageMso="RerouteOnCrossover" onAction="Liens_croises_cellules_Click"/>
</group>
<group id="group_3" label="Infos dynamiques" imageMso="ProjectInformationDialog" autoScale="true">
<menu id="menu_1" label="Barre de statut">
<button id="button_19" label="formulaire" onAction="Type_formulaire_Click"/>
<button id="button_20" label="Excel" onAction="Type_Excel_Click"/>
<button id="button_21" label="masquée" onAction="Type_masquee_Click"/>
<button id="button_22" label="feuille" onAction="Mode_1_feuille_Click"/>
<button id="button_23" label="feuilles" onAction="Mode_2_feuilles_Click"/>
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
'callback created by [[''creatorRibbonX'']]
'[createRibbonX Application] created by (''patricktoulon'')
'Version 2025 V 7.0
'POUR MEMO 4 fonctions importantes à connaitre pour les controls dynamiques
'L 'objet IRibbonUI possède 4 méthodes :
'1° myribbon.Invalidate() qui actualise en une seule fois tous les contrôles personnalisés du classeur.
'2° myribbon.InvalidateControl("Id du control") qui actualise un contrôle particulier (ControlID correspond à l'identificateur unique du contrôle).
'3° myRibbon.ActivateTab ("id de l'onglet à activer")qui active l'onglet désigné par son ID dans les parenthèses
'4° myRibbon.ActivateTabMso ("idMso de l'onglet à activer")qui active l'onglet désigné par son IDMSO dans les parenthèses
'5° myRibbonInvalidateControlMso ("Id de l'element"(onglet/group/control) )qui actualise l'element désigné par son ID dans les parenthèses 'Nom du projet:[C:\Users\patricktoulon\Desktop\creatorRibbonX\creatorRibbonX 2025 V 6.0-6.2\Mes projets\project_dudu2novembre2025\exemple.xml]
'créé le:[04/11/2025]
Public myRibbon As IRibbonUI ' {Variable pour l'object ribbon}
'Callback pour l' event customUI.onLoad
Sub CustomUIOnLoad(ribbon As IRibbonUI)
Set myRibbon = ribbon
End Sub
'1° loader une png dans un control image dans un userform
'Function LoadPngPicture(ByVal Filename As String) As StdPicture
' With CreateObject("WIA.ImageFile")
' .LoadFile Filename
' Set LoadPngPicture = .FileData.Picture
' End With
'End Function
'l'event ribbon Load_Image
Public Sub Ribbon_loadImage(imageId As String, ByRef image)
Set image = CreateColorBall(imageId)
End Sub
'*****************************************************************************************************
' ___ _ _______ __ _ ____ _ _ _______ ___ _ _ _ ___ _ _.
' // \\ /\\ // // \\ // // // // // // \\ // // // // \\ //| //
' //___// //__\ // //__// // // //__// // // // // // // // // // | //
' // // \\ // // \\ // // // \\ // // // // // // // // // | //
'// // // // // // // //___ // \\ // \\__// //__// //___ \\__// // |//
'****************************************************************************************************
' module : fonction pour créer icones couleur dynamiquement (collection StdPicture)
' auteur : Patrick Verne alias patricktoulon sur ExcelDownload
' version : 1.0
' date version : 10/12/2025
'****************************************************************************************************
' peut être utiliser dans un userform(bloquer la ligne fillrect en blanc pour garder la transparence avec les label dans userform)
' exemple d'utilisation pour un control dans un userform
' préférer le control label qui garde le fond transparent ,le control image lui remplace le vide autour par du noir
' Set Label1.Picture = CreateColorBall(vbRed)
' ==========================================================
Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Type PICTDESC
cbSizeofStruct As Long
picType As Long
hBmp As LongPtr
hPal As LongPtr
Reserved As LongPtr
End Type
Private Const PICTYPE_BITMAP As Long = 1
Private Declare PtrSafe Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As LongPtr) As LongPtr
Private Declare PtrSafe Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As LongPtr, ByVal nWidth As Long, ByVal nHeight As Long) As LongPtr
Private Declare PtrSafe Function SelectObject Lib "gdi32" (ByVal hdc As LongPtr, ByVal hObject As LongPtr) As LongPtr
Private Declare PtrSafe Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As LongPtr
Private Declare PtrSafe Function FillRect Lib "user32" (ByVal hdc As LongPtr, ByRef lpRect As RECT, ByVal hBrush As LongPtr) As Long
Private Declare PtrSafe Function Ellipse Lib "gdi32" (ByVal hdc As LongPtr, ByVal nLeftRect As Long, ByVal nTopRect As Long, ByVal nRightRect As Long, ByVal nBottomRect As Long) As Long
Private Declare PtrSafe Function DeleteObject Lib "gdi32" (ByVal hObject As LongPtr) As Long
Private Declare PtrSafe Function GetDC Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
Private Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hwnd As LongPtr, ByVal hdc As LongPtr) As Long
Private Declare PtrSafe Function OleCreatePictureIndirect Lib "oleaut32" (ByRef PicDesc As PICTDESC, ByRef RefIID As GUID, ByVal fPictureOwnsHandle As LongPtr, ByRef IPic As IPicture) As Long
Private Declare PtrSafe Function CLSIDFromString Lib "ole32" (ByVal lpsz As LongPtr, ByRef pclsid As GUID) As Long
' ==========================================================
' CRÉATION D'UNE BOULE DE COULEUR EN STDPICTURE
' ==========================================================
Public Function CreateColorBall(ByVal lngColor As Long, Optional ByVal W As Long = 32, Optional ByVal H As Long = 32) As StdPicture
Dim hdcScreen As LongPtr
Dim hdcMem As LongPtr
Dim hBmp As LongPtr
Dim hBrWhite As LongPtr
Dim hBrColor As LongPtr
Dim oldBmp As LongPtr
Dim pic As PICTDESC
Dim IPic As IPicture
Dim IID_IPicture As GUID
' GUID IPicture
CLSIDFromString StrPtr("{7BF80980-BF32-101A-8BBB-00AA00300CAB}"), IID_IPicture
' DC de référence : bureau
hdcScreen = GetDC(0)
hdcMem = CreateCompatibleDC(hdcScreen)
' Bitmap compatible
hBmp = CreateCompatibleBitmap(hdcScreen, W, H)
oldBmp = SelectObject(hdcMem, hBmp)
' --- Remplir le fond en blanc ---
hBrWhite = CreateSolidBrush(RGB(255, 255, 255))
Dim r As RECT
r.Left = 0
r.Top = 0
r.Right = W
r.Bottom = H
FillRect hdcMem, r, hBrWhite
DeleteObject hBrWhite
' --- Dessiner la boule ---
hBrColor = CreateSolidBrush(lngColor)
SelectObject hdcMem, hBrColor
Ellipse hdcMem, 0, 0, W, H
DeleteObject hBrColor
' --- Conversion en StdPicture ---
pic.cbSizeofStruct = Len(pic)
pic.picType = PICTYPE_BITMAP
pic.hBmp = hBmp
OleCreatePictureIndirect pic, IID_IPicture, 1, IPic
Set CreateColorBall = IPic
' Nettoyage
SelectObject hdcMem, oldBmp
ReleaseDC 0, hdcScreen
End Function
We use cookies and similar technologies for the following purposes:
Est ce que vous acceptez les cookies et ces technologies?
We use cookies and similar technologies for the following purposes:
Est ce que vous acceptez les cookies et ces technologies?