<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI onLoad="RibbonOnLoad" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<!-- Creamos tab para el administrador con sus botones-->
<tab id="customTab" label="BPR Moldeo" insertAfterMso="TabView">
<!-- Creamos grupo de botones 2 "Acceso"-->
<group id="customGroup2" label="Activar sistema" tag="Accede">
<button id="customButton12" label="Log in" size="large" onAction="sesion" imageMso="ReviewProtectWorkbook" />
</group>
<!--Group 0 "Generar BPR"-->
<group id="customGroup0" label="BPRs Moldeo" getVisible="GetVisible" tag="LGGenerar">
<button id="customButton0" label="Generar" size="large" onAction="Inicio" imageMso="PivotTableInsert" />
</group>
<!-- Group Note-->
<group id="customGroup1" label="By I. Q. Leonel Garcia [QA AL]" getVisible="GetVisible" tag="LGAyuda">
<button id="customButton11" label="Dudas / Comentarios" size="large" onAction="Envia_Mail" imageMso="FileSendMenu" />
</group>
<!-- Group Exit-->
<group id="customGroup3" label="Desconexión" getVisible="GetVisible" tag="LGSalir">
<button id="customButton13" label="Salir" size="large" onAction="Oculta" imageMso="WindowClose" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Option Explicit
Public Rib As IRibbonUI
Public MyTag As String
'Callback for customUI.onLoad
Public Sub RibbonOnLoad(ribbon As IRibbonUI)
Set Rib = ribbon
End Sub
Sub GetVisible(control As IRibbonControl, ByRef visible)
If MyTag = "show" Then
visible = True
Else
If control.Tag Like MyTag Then
visible = True
Else
visible = False
End If
End If
End Sub
Sub RefreshRibbon(Tag As String)
MyTag = Tag
'If Rib Is Nothing Then
' MsgBox "Error, reinicia Excel"
'Else
Rib.Invalidate
'End If
End Sub
Sub ShowAllButtons()
'Show All
Call RefreshRibbon(Tag:="*")
End Sub
Sub HideButtons()
'Hide all with a Tag that start with "LG"
Call RefreshRibbon(Tag:="Login")
End Sub
Sub Oculta(control As IRibbonControl)
Call HideButtons
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.