cagataybaser
New member
- Joined
- Aug 14, 2014
- Messages
- 13
- Reaction score
- 0
- Points
- 0
Hello everyone,
I have this xml and vba code for dynamic menu in to ribbon,everything works perfect except i need to make it static (if you use c,c++ or java you know what i mean) to put more buttons dynamically
Best Regards
I have this xml and vba code for dynamic menu in to ribbon,everything works perfect except i need to make it static (if you use c,c++ or java you know what i mean) to put more buttons dynamically
HTML:
<dynamicMenu id="dynTabMenu"
label="Modells"
imageMso="CreateTable"
size="large"
getContent="dynTabMenu_getContent"/>
</group>
Code:
Private Sub dynTabMenu_getContent(control As IRibbonControl, ByRef returnedVal)
Dim strXML As String, strLabel As String, strTag As String
Dim wks As Worksheet
Dim strn As String
Dim lastcolumn As Double
strn = Range("C11").Value
On Error GoTo Fehler
strXML = "<menu xmlns=""[URL]http://schemas.microsoft.com/office/2006/01/customui[/URL]"">" & vbLf
For Each wks In ThisWorkbook.Worksheets
strTag = Mask(strn, False)
strLabel = Mask(strn, True)
If wks.Visible = True Then
strXML = strXML & "<button id=""" & strn & """" _
& " label=""" & strn & """" _
& " tag=""" & strn & """" _
& " onAction=""gallipolli""/>" & vbLf
Else
strXML = strXML & "<button id=""" & strn & """" _
& " label=""" & strn & """" _
& " tag=""" & strn & """" _
& " screentip=""mein kleiner Screentip""" _
& " supertip=""Diese Tabelle ist nicht sichtbar!""" _
& " imageMso=""StopLeftToRight""" _
& " onAction=""gallipolli""/>" & vbLf
End If
Next wks
strXML = strXML & "</menu>"
returnedVal = strXML
Exit Sub
Fehler:
MsgBox "Fehler in: dynTabMenu_getContent" & vbLf & _
Err.Description, vbCritical, "Fehler!"
End Sub
Best Regards