Excel Add In's Custom Ribbon Tab Will Not Display
Asked Answered
I

5

6

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.

Incoherence answered 15/5, 2013 at 14:33 Comment(5)
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.Hulk
It worked... ha. What a pain, though... sure wish I could identify what caused the issue.Incoherence
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...Hulk
Might be worth checking out link it helped me out today.Baleful
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.Buber
M
11

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...

Molina answered 22/3, 2017 at 10:5 Comment(3)
May be strange.. MSDN says the same :) 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.Midshipman
Similarly, if you use RibbonXML you should add an id attribute to your <tab> and remove msoId attribute.Aldershot
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.Hardesty
I
3

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();
    }
Introit answered 25/7, 2016 at 21:16 Comment(1)
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!Tantalite
A
2

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

Arbela answered 7/1, 2015 at 20:43 Comment(0)
S
0

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

Siena answered 30/7, 2020 at 17:33 Comment(0)
W
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.

Watermark answered 24/7, 2021 at 18:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.