3

I have a VSTO for Excel project with a custom ribbon tab. The solution builds without errors. I can run the solution. It launches Excel and displays the custom ribbon tab and task pane without any issue.

When I try to open the designer for the custom ribbon tab in Visual Studio 2019, I get the following error:

Could not find type 'Microsoft.Office.Tools.Ribbon.RibbonTab'. Please make sure the assembly that contains this type is referenced. If this type is a part of a development project, make sure that the project has been successfully built using the settings for your current platform or Any CPU.

  • The solution builds and runs without any issues.
  • When I expand the error info, There is no stack trace or error line information available for this error.
  • The build settings are set to 'Any CPU'.
  • The assemblies that contain 'Microsoft.Office.Tools.Ribbon.RibbonTab' are included in the project references. These are Microsoft.Office.Tools.Common and Microsoft.Office.Tools.Common.v4.0.Utilities.
  • I have tried to Clean, Rebuild, and Restart Visual Studio 2019. This had no effect.
  • I could not find anything definitive when I Check Windows Forms Design-Time error list.

Would anyone know how to address this issue so that I can open the custom ribbon in the designer?

Is VSTO still supported by Microsoft? All documentation appears to be several years old.

Jack J Jun
  • 5,633
  • 1
  • 9
  • 27
Doug Kimzey
  • 1,019
  • 2
  • 17
  • 32
  • is the design-time adapter add-in enabled in Excel? – Eugene Astafiev Mar 23 '21 at 20:05
  • Create a new VSTO project with a ribbon and see if the same happens. Detail the steps to what you have done back here if it fails. Maybe we are missing something you are doing that might raise a red flag.(?) What version of .Net are you targetting? – ΩmegaMan Mar 24 '21 at 14:23

1 Answers1

0

This is a Visual Studio issue, not a C#/Build/DLL linkage issue.

Make sure your Visual Studio setup (do the Modify in the installer (#1) if already installed) has these two components checked:

Visual Studio Modification-VSTO


Is VSTO still supported by Microsoft?

They are moving to an online office365 addin (my words) type VSTO. As to new features, not recently. One can still put in a Visual Studio support ticket if you have the right subscription.


I have never had any issues with ribbons, but sometimes the winforms res files in designer do not show and I use the JetBrains Rider editor to view those controls when VS fails.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • They are not moving anywhere. There is no plans to shut down VSTO. – Eugene Astafiev Mar 23 '21 at 17:05
  • Thanks very much for the suggestions, unfortunately Office Development Tools and Visual Studio Tools for Office are already installed. The res file for the ribbon appears in the solution. – Doug Kimzey Mar 23 '21 at 17:07
  • Would you know if it is possible to use the new Office 365 Add-Ins off-line? For example on a factory floor that has limited to no wireless access. We also have some clients who have sensitive data and IP. To mitigate Insider Threat, we are contractually obligated to keep all data off of The Internet and out of clouds . – Doug Kimzey Mar 23 '21 at 17:10
  • You will have to ask that in a different question. – ΩmegaMan Mar 23 '21 at 19:59
  • I was able to get the designer to load properly. While trying OmegaMan's suggestions, I noticed that an update was available for Visual Studio 2019 Professional. I went back and did the update. The installation of Visual Studio 2019 v 16.9.2 seemed to correct the issue with the ribbon bar designer. I do not know if this was a known bug or the installation of the update repaired something in my instance of Visual Studio 2019. – Doug Kimzey Mar 24 '21 at 11:35
  • Why was OmegaMan's answer discounted with a -1? While I already had VSTO and Office Developer Tools for Visual Studio installed, I felt that this was worth a look. It is often the basic items that cause problems. Checking OmegaMan's suggestion, indirectly led to a fix. – Doug Kimzey Mar 24 '21 at 11:40
  • There is a good chunk of people who's dogma is that, if its not **the** answer or the question is somehow invalid, that people who give answers should be voted down. Last week I replied to someone who was new and whose answer needed help, but they didn't speak the language. I put in a thoughtful answer and was voted down by someone who questioned **why** I provide answers to people who can't ask proper questions. I will always try to help and give an answer or in some cases an alternative answer regardless....that is how **I** see the site. :-) – ΩmegaMan Mar 24 '21 at 14:21
  • 1
    This problem popped-up for me today. I didn't know what to do as I have everything installed as it should be... so I installed some .NET frameworks (4.7 & 4.8?) that I'm not using. The problem went away by itself after that. Note that I have VS2019 installed over a previous install of VS2017 - not sure if that's relevant. Thanks for the above discussion as it helped. – Sam Azer May 04 '21 at 18:48