ich habe mir eine Ribbon erstellt. Nun meine Frage. Wie kann ich erreichen, dass das Ribbon nur angezeigt wird wenn das Tabellenblatt3 ausgewählt ist.
Wechsel ich wieder zu Blatt2 oder 1 soll das Ribbon nicht mehr sichtbar sein
Gruss
Stefan
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
objRibbon.Invalidate
End Sub
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15
In einem allgemeinen Modul:Option Private Module
Option Explicit
Public objRibbon As IRibbonUI
Public Sub onLoad_Test23(ribbon As IRibbonUI)
Set objRibbon = ribbon
End Sub
Public Sub Visible_Test23(control As IRibbonControl, ByRef returnValue)
If ActiveSheet.Name = "Tabelle1" Then returnValue = True
End Sub
Public Sub onAction_Test23(control As IRibbonControl)
MsgBox control.ID
End Sub
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15
RibbonX-Code:<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
onLoad="onLoad_Test23" >
<ribbon>
<tabs>
<tab id="tab0" label="Erstes" getVisible="Visible_Test23" >
<group id="grp0" label="Erste">
<button id="btn0" label="Erster" imageMso="HappyFace"
size="large" onAction="onAction_Test23" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15
Gruß, René
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="onLoad_Test23" >
<ribbon>
<tabs>
<tab id="tab0" label="Erstes" getVisible="Visible_Test23" >
<group id="grp0" label="Erste">
<button id="btn0" label="Erster" imageMso="HappyFace" size="large" onAction="onAction_Test23" />
</group>
</tab>
<tab idMso="TabHome" getVisible="Visible_Test23" />
<tab idMso="TabDeveloper" getVisible="Visible_Test23" />
</tabs>
</ribbon>
</customUI>
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15
Public Sub onLoad_Test23(ribbon As IRibbonUI)
Set objRibbon = ribbon
End Sub
Public Sub Visible_Test23(control As IRibbonControl, ByRef returnValue)
If ActiveSheet.Name = "Tabelle2" Then
returnValue = False
Else
returnedVal = True
End If
End Sub
Public Sub onAction_Test23(control As IRibbonControl)
MsgBox control.ID
End Sub
Leider weiß ich aber nicht warum es nicht klappt.
Public Sub Visible_Test23(control As IRibbonControl, ByRef returnValue)
If ActiveSheet.Name = "Tabelle1" Then returnValue = True
If ActiveSheet.Name = "Tabelle3" Then returnValue = True
End Sub
Gruss
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
objRibbon.Invalidate
End Sub
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15
In ein allgemeines Modul:Option Private Module
Option Explicit
Public objRibbon As IRibbonUI
Public Sub onLoad_Test23(ribbon As IRibbonUI)
Set objRibbon = ribbon
End Sub
Public Sub Visible_Test23(control As IRibbonControl, ByRef returnValue)
Select Case ActiveSheet.Name
Case "Tabelle1"
returnValue = True
Case Else
returnValue = False
End Select
End Sub
Public Sub onAction_Test23(control As IRibbonControl)
MsgBox control.ID
End Sub
Private Sub Visible_inTabs(control As IRibbonControl, ByRef returnValue)
Select Case ActiveSheet.Name
Case "Tabelle2", "Tabelle3"
returnValue = True
Case Else
returnValue = False
End Select
End Sub
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15
RibbonX-Code:<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
onLoad="onLoad_Test23" >
<ribbon>
<tabs>
<tab id="tab0" label="Erstes" getVisible="Visible_Test23" >
<group id="grp0" label="Erste">
<button id="btn0" label="Erster" imageMso="HappyFace"
size="large" onAction="onAction_Test23" />
</group>
</tab>
<tab idMso="TabHome" getVisible="Visible_inTabs" />
<tab idMso="TabDeveloper" getVisible="Visible_inTabs" />
</tabs>
</ribbon>
</customUI>
VBA/HTML - CodeConverter für Office-Foren
AddIn für Excel/Word 2000-2010 - komplett in VBA geschrieben von Lukas Mosimann
Projektbetreuung durch mumpel
Code erstellt und getestet in Office 15