Excel添加的自定义功能区选项卡将不显示 [英] Excel Add In's Custom Ribbon Tab Will Not Display
问题描述
我已经为Excel创建了一个应用程序级加载项来自动执行某些任务。我使用VS2012模板Visual C#> Office> 2010> Excel 2010加载项。
而不是每次Excel执行操作窗格时,我选择了按照以下说明创建自定义功能区选项卡:
可笑,嘿?
但是,奇怪的是,它的作品...
I've created an application level add-in for Excel to automate some tasks. I used the VS2012 template Visual C# > Office > 2010 > Excel 2010 Add-In.
Rather than having an action pane open every time Excel does, I've opted to create a custom ribbon tab following these instructions:
http://msdn.microsoft.com/en-us/library/vstudio/bb386104.aspx
However, when I build my project, the tab does not display. I have verified the add-in is loading, and all of its features function properly, except the Ribbon. I created a simple form to test this, which loads as expected.
I then tried creating an Excel 2010 Workbook project. After adding the Ribbon (using the same steps as before) and building the project, it simply works; the ribbon tab appears as expected.
I've tried overriding ThisAddIn.CreateRibbonExtensibilityObject() to return my ribbon object, created via Globals.Factory.GetRibbonFactory().CreateRibbonManager. Again, no dice.
I'm at a loss now.
I also had this problem, where my VSTO ribbon wasn't being displayed.
Here's my solution, using Excel 2013 and VS2015.
What you need to do is:
- Open the Ribbon Designer window
- Select the
RibbonTab
object - In the "Properties" window, expand "
ControlId
" branch, and change theControlIdType
from "Office
" to "Custom
"
Ridiculous, hey ?
But, strangely, it works...
这篇关于Excel添加的自定义功能区选项卡将不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!