5

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.

Michael
  • 1,803
  • 1
  • 17
  • 26
  • 3
    Can I suggest you have a go at creating a brand new Add-In project (like you did for the Workbook proj), adding a Ribbon and seeing if that works (it definitely works in VS2010, as I've done it many times). There are loads of fiddly settings when working with Add-Ins and you could have adjusted one without realising that prevents the ribbon from loading correctly. – steveo40 May 15 '13 at 15:08
  • It worked... ha. What a pain, though... sure wish I could identify what caused the issue. – Michael May 15 '13 at 15:15
  • 1
    Yeah, I've had a few occasions where I've somehow broken something and I'm now resigned to the fact that VS is just so complicated that it's sometimes easier to create a new project and copy everything over... – steveo40 May 15 '13 at 15:19
  • Might be worth checking out [link](http://stackoverflow.com/questions/9300526/custom-ribbon-in-vsto-addin-for-outlook-2010-doesnt-display/9300805#9300805) it helped me out today. – NAJ Jul 24 '14 at 09:30
  • 1
    There's an option in newer versions of Excel (under File -> Options -> Advanced, in the General section) called "Show add-in user interface errors" which is very useful. – Govert Apr 20 '15 at 19:50

5 Answers5

10

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"

enter image description here

Ridiculous, hey ?

But, strangely, it works...

Mike Gledhill
  • 27,846
  • 7
  • 149
  • 159
  • 1
    May be strange.. MSDN says the same :) https://msdn.microsoft.com/en-us/library/bb386104.aspx. Otherwise ribbon is visible under built-in "ADD-IN" ribbon group. Since we need our label, need this change. – sura2k Nov 18 '17 at 04:57
  • Similarly, if you use RibbonXML you should add an `id` attribute to your `` and remove `msoId` attribute. – Ehsan88 Jan 15 '19 at 08:07
  • Hi Mike, We wasted a lot of time trying to find that setting. Thanks! Do you know exactly where the setting is stored? I am trying to see the text file (and text within that file) containing that setting. – Keith Howard Jan 19 '21 at 13:19
2

After much pain, I found that the Position property of the RibbonGroup must be Default.

Paaske
  • 4,345
  • 1
  • 21
  • 33
2

I had this happen with using the xml ribbon developer tool. You have to add this code (or similar functionality into ThisAddIn.cs (or primary add in class)

    protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
    {
      return new Ribbon1();
    }
  • 2
    Wow, after a lot of frustration, this proved to be what was missing! The weird thing is I thought this was a piece of managed code, so I don't know why it was missing for me... Thanks! – jones-chris Sep 30 '16 at 23:10
0

Default tab's visible property value is False, set it to True.

0

I switched back to Visual Studio 2017 Community edition and it worked for me.

As an up-gradation process, I'd migrated my VSTO Add-Ins from VS 2017 to VS 2019. When I compiled my Add-Ins on VS 2019 Community Add-Ins worked well for MS Word and Outlook, but MS Excel was not showing the Add-In (Ribbon)

Tried many suggestions but did not work. After switching back to VS 2017 Community it started working well.

Ashish Tripathi
  • 580
  • 4
  • 18