问题是您将组的ID声明为
idQ="x:ORSErlang64"
但您没有声明名称空间
x
是
上
customUI
元素,您需要定义
x个
命名空间,例如
<customUI xmlns="..." xmlns:x="http://yourapp.com">
例如:
<DnaLibrary RuntimeVersion="v4.0" Name="Ribbon Tests" Description="Ribbon Tests Description (not used)">
<![CDATA[
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core
Imports ExcelDna.Integration.CustomUI
<ComVisible(True)> _
Public Class MyRibbon
Inherits ExcelRibbon
Public Sub OnButtonPressed(control as IRibbonControl)
MsgBox("My Button Pressed on control " & control.Id,, "ExcelDna Ribbon!")
End Sub
End Class
]]>
<CustomUI>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:x="http://caioproiete.net">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group idQ="x:ORSErlang64" label="ORSErlang64">
<button id="C1" label="Set Default" size="large"
imageMso="StartAfterPrevious" onAction="OnButtonPressed" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
</CustomUI>
</DnaLibrary>