我创建了一个出现在 UI 中的 Excel 插件,但是每当我单击它时它都不起作用。
Option Explicit
Public sheetscol As Collection, depshtnm
Public hasdeps As Boolean
'***********************************
'*finds the external dependencies of the cell, and places them in the 'sheetscol' collection
'***********************************
Sub depfinder_eventhandler(control As IRibbonControl)
depfinder
End Sub
'--------------
Sub depfinder
...
End sub
这是 XML CustomUI:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:m="MattSinSpace">
<ribbon>
<tabs>
<tab idQ="m:MattTab" label="Matt Tools" insertAfterMso="TabHome">
<group idQ="m:migration" label="migration tools">
<button idQ="m:DepFinderButton1" label="Highlight Dependencies" size="large"
onAction="depfinder_eventhandler" imageMso="HappyFace" />
</group>
<group idQ="m:RS1" visible = "false"/>
<group idQ="m:RS2" visible = "false"/>
</tab>
</tabs>
</ribbon>
</customUI>
我在制作插件方面非常业余,我一直在使用这个页面来帮助我:
http://erpcoder.wordpress.com/2012/05/30/how-to-create-a-custom-ribbon-addin-for-excel-2010/
看起来一切都很好,在我的代码和 UI 中,唯一的区别是我已经包含了命名空间。