Ribbonmenü funkioniert unter Excel2013 nicht.
08.01.2018 09:33:40
Kasimir
In einer Exceldatei wird beim Öffnen ein neues Menü erzeugt. Dieses Menü hat 3 Groups und in 2 Groups jeweils einen Button. Das 3. Group ist genau zwischen den beiden anderen Groups und wird beim Öffnen mit einem Text aus einem Makro gefüllt. Und hier liegt das Problem: Unter Excel 2010 funktioniert das Füllen des 3. Groups mit dem Text. Starte ich die Datei unter Excel 2013, funktioniert das Ganze nicht. Das Group bleibt leer. Nachfolgend die Daten, die im CustomUI.xml und CustomUI14.xml stehen:
CustomUI.xml
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad" loadImage="LoadImages">
<ribbon startFromScratch="false">
<tabs>
<tab id="AddInSetArtikel" label="Artikelbilder einlesen...." getVisible ="GetVisible">
<group id="grpBilderEinlesen" label=" Artikelbilder.... " getVisible ="GetVisible">
<button id="btnBilderEinlesen" size="large" label="Artikelbilder einlesen...." image="PictureInsight_48x48" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
</group>
<group id="grpLeer" getLabel="GetLabel" >
</group>
<group id="grpInfos" label="Infos...." getVisible ="GetVisible">
<menu id="mnuInfo" size="large" itemSize="large" label="Info...." screentip="Info" supertip="Info" imageMso="Help" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" getVisible="GetVisible" getEnabled="GetEnabled" >
<button id="btnInfo" label="Info..." screentip="Info" supertip="Öffnet Fenster, dass Auskunft über die Programmversion gibt" imageMso="Info" tag="RibbonName:=;inMenu:=mnuInfo;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
CustomUI14.xml
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnRibbonLoad">
<ribbon startFromScratch="false">
<tabs>
<tab id="AddInSetArtikel" label="Artikelbilder einlesen...." getVisible ="GetVisible">
<group id="grpBilderEinlesen" label=" Artikelbilder.... " getVisible ="GetVisible">
<button id="btnBilderEinlesen" size="large" label="Artikelbilder einlesen...." image="PictureInsight_48x48" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
</group>
<group id="grpLeer" getLabel="GetLabel" >
</group>
<group id="grpInfos" label="Infos...." getVisible ="GetVisible">
<menu id="mnuInfo" size="large" itemSize="large" label="Info...." screentip="Info" supertip="Info" imageMso="Help" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" getVisible="GetVisible" getEnabled="GetEnabled" >
<button id="btnInfo" label="Info..." screentip="Info" supertip="Öffnet Fenster, dass Auskunft über die Programmversion gibt" imageMso="Info" tag="RibbonName:=;inMenu:=mnuInfo;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Und nun noch der VBA-Code für das Menü:
Option Explicit
Option Private Module
Public gobjRibbon As IRibbonUI
Public Sub OnRibbonLoad(ribbon As IRibbonUI)
Set gobjRibbon = ribbon
gobjRibbon.ActivateTab "AddInSetArtikel"
End Sub
Public Sub OnActionButton(control As IRibbonControl)
Select Case control.ID
Case "btnBilderEinlesen"
Call Bilder_einlesen_Vorabauswahl
Case "btnInfo"
Call Info_öffnen
End Select
End Sub
Public Sub GetEnabled(control As IRibbonControl, ByRef enabled)
enabled = True
End Sub
Public Sub GetVisible(control As IRibbonControl, ByRef visible)
visible = True
End Sub
Sub GetLabel(control As IRibbonControl, ByRef label)Select Case control.ID
Case Else
label = " " _
& " " _
& " " _
& " " _
& "Diese Datei lebt seit 2000- " & Year(Now()) & "!"
End Select
End Sub
Hat jemand vielleicht eine Idee, warum das obige unter Excel2010 funktioniert, unter Excel 2013 aber nicht? Das würde mir ein ganzes Stück weiterhelfen.
Danke Euch schon mal bei der Hilfestellung,
Kasimir
PS: Sorry für die Darstellung, habe ich nicht anders hinbekommen!