0

I have coded an Excel add-in using Visual C#. This add-in appears as a COM add-in in Excel. However, I am quite sure that it used to appear as an Excel/VSTO Add-In in Excel before an update of Visual Studio. (I know that I was able to access the Globals class. This thread says that Globals can only be accessed in Excel add-ins.)

So my question is: How can I make my COM add-in an Excel/VSTO add-in?

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • 1
    Where are you looking in Excel? Can you show us a screen shot? For example, the COM Add-ins dialog box in the Developer tab doesn't differentiate between VSTO and other kinds of COM Add-in. Note that a VSTO add-in is also a COM Add-in - it bases on the IDTExtensibility2 interface, just as every COM add-in does. Microsoft simply made it easier to create the COM add-in and included some extensions (such as bindings and the Ribbon designer). – Cindy Meister Jul 17 '19 at 08:53

2 Answers2

0

When you create an Office project, Visual Studio automatically generates a class named Globals in the project. You can use the Globals class to access several different project items at run time from any code in the project.

You can start writing your VSTO Add-in code in the ThisAddIn class. Visual Studio automatically generates this class in the ThisAddIn.vb (in Visual Basic) or ThisAddIn.cs (in C#) code file in your VSTO Add-in project. The Visual Studio Tools for Office runtime automatically instantiates this class for you when the Microsoft Office application loads your VSTO Add-in. Read more about that in the Program VSTO Add-ins article.

Also, see Walkthrough: Create your first VSTO Add-in for Excel.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
0

Well, if you used Microsoft.Office.Interop.Excel.... thats COM... Interoperability. VSTO is a COM.