<?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
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE