我在Excel 2007工具栏中添加了一些新的“按钮”
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="customTab" label="ClaroTech">
<group id="customGroup" label="Animalcare Group">
<button id="customButton1" label="Custom Button1" imageMso="SmartArtChangeColorsGallery" size="large" onAction="Callback1" />
<button id="customButton2" label="Custom Button2" imageMso="SmartArtChangeColorsGallery" size="large" onAction="Callback2" />
</group>
</tab>
</tabs>
</ribbon>
这可以正常工作,并显示工具栏。我已将以下代码添加到工作表模块之一
Sub Callback2()
MsgBox "Welcome"
End Sub
我不知道是什么导致此错误,不胜感激。
这不是有效的按钮回调签名。它应该是:
Sub Callback2(control As IRibbonControl)
MsgBox "Welcome"
End Sub
如果使用CustomUI编辑器,它将为您生成回调存根。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句