如何使用VBA添加自定义条带选项卡?我正在寻找一种方法,以添加一个自定义选项卡在Excel丝带,其中将携带几个按钮。我偶然找到了一些资源,通过谷歌(Google)解决了这个问题,但它们看起来都很诡异,而且复杂得离谱。快速而简单的方法是什么?当我的VBA被加载到Excel时,我希望新的选项卡被加载。更新:我试过这个例子这里但是在最后一条指令中得到一个“Object Required”错误:Public Sub AddHighlightRibbon()Dim ribbonXml As StringribbonXml = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"ribbonXml = ribbonXml + " <mso:ribbon>"ribbonXml = ribbonXml + " <mso:qat/>"ribbonXml = ribbonXml + " <mso:tabs>"ribbonXml = ribbonXml + " <mso:tab id=""highlightTab"" label=""Highlight"" insertBeforeQ=""mso:TabFormat"">"ribbonXml = ribbonXml + " <mso:group id=""testGroup"" label=""Test"" autoScale=""true"">"ribbonXml = ribbonXml + " <mso:button id=""highlightManualTasks"" label=""Toggle Manual Task Color"" "ribbonXml = ribbonXml + "imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"ribbonXml = ribbonXml + " </mso:group>"ribbonXml = ribbonXml + " </mso:tab>"ribbonXml = ribbonXml + " </mso:tabs>"ribbonXml = ribbonXml + " </mso:ribbon>"ribbonXml = ribbonXml + "</mso:customUI>"ActiveProject.SetCustomUI (ribbonXml)End Sub
添加回答
举报
0/150
提交
取消