Make an Excel COM add-in a VSTO add-in - excel

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?

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.

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

Related

Office add-in Excel VSTO office 365 (desktop) support

Do you know if this is possible to create a VSTO add-in for excel in an office 365 suite (on desktop, of course)?
Officially, it says it is supported.
But, if I create an empty project on VisualStudio with the default "Office 2013 & 2016 VSTO add-in", it does not load.
But, it works on other machines, with excel 2016.
Can you help me with this?
I already tried many things. And, it seems that the add-in does not even show in the list of COM add-ins in the setup menu. It's not disabled; and, if I look at the registry, the load behavior is 3.
The only strange thing that I found is that when I try to link manually the .dll file using the "add-in" menu, it says that the dll is not a valid excel add-in.
But, if I do it another way and click to the .vsto file, the explorer says that the add-in has been installed correctly..
Thanks a lot

VBA Excel TaskPane [duplicate]

Is it possible to build a Custom Task Pane for Excel 2007 or 2010 without Visual Studio, that is, using only VBA?
I found this other question but it's not working for me.
I think, as of now, the answer to your question is "No".
As far as I can tell, extending any Office application (Excel, PowerPoint, etc.) with a Custom Task Pane / Application Pane requires a COM add-in, that needs to be developed with Visual Studio.
At least for Office 2007, this article (https://msdn.microsoft.com/en-us/library/aa338197%28v=office.12%29.aspx) specifically states that:
(..) custom task panes are deployed as Component Object Model (COM)
add-ins (..)
The same article states that VBA does not support creating such custom task panes.
You can create custom task panes in any language that supports COM and
that enables you to create dynamic-linked library (DLL) files, for
example, Microsoft Visual Basic 6.0, Microsoft Visual Basic .NET,
Microsoft Visual C++, Microsoft Visual C++ .NET, and Microsoft Visual
C. However, Microsoft Visual Basic for Applications (VBA) does not
support creating custom task panes. Custom task panes use other
technologies with which you are already familiar, for example,
Microsoft ActiveX controls.
This article shows how to create a custom task pane with C# or VB in VS2013: https://msdn.microsoft.com/en-us/library/aa942846.aspx
All in all, this article (https://msdn.microsoft.com/en-us/library/bb398242.aspx) states that you need Microsoft Office Developer Tools for developing office solutions, which is only bundled with
Visual Studio Professional
Visual Studio Premium
Visual Studio Ultimate
If you only have VBA available it seems like your are stuck with the original User Forms for now.
I'm looking the same question.
I "think" the only way to make CTP is through VS.
And only way to make in VBA is with userFrom instead of custom task pane.

open vsto thisworkbook from windows application

I am trying to add VSTO Excel Document Level project using an existing .xlsx document to an existing windows form application project. I have put reference from the Windows App to the VSTO project and manage to import the VSTO project into the Windows App, in addition I have also imported Microsoft.Office.Interop.Excel in the Windows App.
Question is, how to open the Excel Doc in the VSTO from within the Windows App and link withevents the "Thisworkbook" of the Excel doc in the VSTO (like calling globals.thisworkbook)?
I have tried to open directly the excel doc from the win app, however, the code within the vsto doesn't work.
Bunches of thanks for your help!

VSTO add in for multiple office application

I have created a VSTO addin using word 2010 template. I am using .net 4.0.
I am interested same functionality in excel 2010 and Power point 2010. Is it possible the add in, already developed could be reuse in excel and power point 2010.
i.e the same add in will work for word 2010, excel 2010 and Powerpoint 2010. I am giving least preferance to create three addins, one for word 2010, excel 2010 and Powerpoint 2010 as the functionality of all the addin is same.
VSTO doesn't allow creating multihost add-ins. You can choose only one host per project in Visual Studio. Of course, you can create a single MSI installer for all your add-ins and deliver it as a single application. But you need to develop separate add-ins/projects in VS. Moreover, Office applications have different object models.
As an alternative way you may consider using Add-in Express which allows supporting multiple host applications in the single project.

Creating Excel Automation add-in with VC++

I am newbie to Excel addins and Visual Studio. After some search, I came up with the following steps to create Excel automation addin: (I am using VS 2012)
create a C++ ATL project
add a STL Simple object
right-click on the object and add a method (with a IN and RETVAL parameters)
build the solution
register the dll with regsvr32
I am able to register the dll successfully. But the add-in does not show up in the Automation Servers available list in Excel 2010 (installed on my machine on Windows 7). Excel is 32 bit.
Thanks in advance
I was using the wrong regsvr32. Since I am building 32bit dll, I should be using regsvr32 from \Windows\SysWOW64.

Resources