Excel添加的自定义功能区选项卡将不显示 [英] Excel Add In's Custom Ribbon Tab Will Not Display

查看:2363
本文介绍了Excel添加的自定义功能区选项卡将不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为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 the ControlIdType from "Office" to "Custom"

Ridiculous, hey ?

But, strangely, it works...

这篇关于Excel添加的自定义功能区选项卡将不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆