自定义ribbonx XML onAction使其不能加载

我有一个xlam文件,我想添加一个自定义ribbonXbutton。

我使用自定义用户界面编辑器和这个XML“工程”。

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon> <tabs> <tab id="Tab1" label="LeaveReport"> <group id="Group1" label="Formatering"> <button id="Button1" imageMso="ChartSwitchRowColumn" size="large"/ > </group> </tab> </tabs> </ribbon> </customUI> 

但是,如果我添加onaction使button做一些事情,根本不加载。 这意味着标签和button根本就不存在。

 <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon> <tabs> <tab id="Tab1" label="LeaveReport"> <group id="Group1" label="Formatering"> <button id="Button1" imageMso="ChartSwitchRowColumn" size="large"/ onAction="formatera_for_pivot_tabell()"/ > </group> </tab> </tabs> </ribbon> </customUI> 

我也试过没有()
我在这里做错了什么? 没有动作的button是相当无用的: – /