VSTO COM Add-In ProgID - excel

I'm having an issue where the ProgID of the Add-in is MyAddin whereas I want it to be MyAddin.Connect because there's a lot of existing spreadsheets where the VBA references MyAddin.Connect.
I've changed every instance of MyAddin to MyAddin.Connect in the csproj file, manifest, and vsto file. I've changed every instance in the registry.
Even the registry key
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Excel\Addins\MyAddIn
to MyAddIn.Connect
Still when I check the ProgID through VBA, it says MyAddin (the friendly name in the COM Add-Ins Manager is MyAddin.Connect).
Where exactly is the ProgID loaded from within VBA in Excel? I should note it was working perfectly when I was debugging the AddIn through Visual Studio. But when I install it through a InstallShield setup, it just refuses to work.

When we debug the AddIn through the Visual Studio, the entry for AddIn is get added into registry and from there it load that addin.
While installing the AddIn from InstallShield we need to check whether we properly added registry entry for AddIn or not.
Also check the same registry entry under HKCU branch. Because addin gets loaded from HKCU branch as well of registry.

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

Error on install Visual Studio 2012 Add-in in another computer

I made an add-in using VS 2012 and it works fine for me on debugging.
After done, I made a vsi installation file renaming a zip file that contains the .addin, .dll and .vscontent to .vsi
I'd sent this vsi file to another computer, and tried to install.
It's launch VS Content Installer and the installation ocurred with no problem.
But this addin creates a commandbar on top-level menubar (Microsoft.VisualStudio.CommandBars.CommandBar) and includes my addin commandbar inside it.
I'd made a shortcut in Connect.cs to call the addin using ctrl + '
This works fine for me too.
But in other computers, this don't work. The top-level menu and commandbar are not being created, as the shortcut that not works too.
Here is the link of VS with Menubar and Commandbar when are debugging.
http://s4.postimg.org/6j9ptli2l/image.png
Things to check:
If the user uses roaming profiles and/or has his VS add-in directory on a network drive / UNC path... ...the assemblies will not be trusted, and VS will fail to load the add-in.
Also make sure that they have the AddIn checked to load and run...
On the Tools menu, click Add-In Manager.
Is the Add-in registered to run with Visual Studio ?
Can you check that the Add-In dll is installed in the path you asked it to ?
(for locations: See File Locations)

Uninstallation of Excel Addin not removed from MS Excel Addin tab/custom tab

I have an application that is developed using CommanBar tools. As there are much constraints in that, i have planned to shift to the Ribbon(view designer). I created a project like, File->New Project->Excel 2007->Excel Addin for 2010.
Created a sample addin and added a new project to the same solution as I wanted the addin to be added using installer(.msi). I registered the Com Addin in the Registry, but on uninstallation, the files are getting removed only in the registry entry, but not in the MS Excel, the addin still to be remained there. Please help me in this. As I am new to the implementation of Ribbon implementation.
I have used winform c# 4.0.
Thanks in advance.
#kiru - the screen shot for the path you mentioned
Check the path from where the addins are been loaded.
Open Excel
Click File => Options => Addins (Tab)
Select COM Add-ins in Manage dropdown box and click Go
Select the addin and you can see the path where it is been loaded.
If it is from bin directory then follow this
If you are running your msi on development pc clean your solution every time you test your msi.

Error deploying VSTO Office addin

I'm having some issues deploying a Visio addin.
Running the VSTO file works on my computer, but whenever I try and move it to any other user's computer it throws an error on deployment.
I thought it might be a setting I'd set in the project properties so I created an entirely new plugin project and set it to display a message box on startup.
The error I'm getting is:
An error occured during customization install.
The expected element "addIn" was not found in the XML.
This is caused by an issue with Clickonce.
I found a workaround by installing the addin using MSI.
This Guide was a lot of help.
Taken from the section about registry settings for the msi installation:
It is important to note the ‘|vstolocal’ value appended to the end of the Manifest value. This informs the VSTO runtime that it is locally installed and to not invoke the ClickOnce installer.
I'm having the same issue with our Word, Excel, Outlook and PowerPoint add-in. The installation of the msi runs perfect.
When starting Word for example, the Add-in itself gets 'installed' and then I receive the error.
I have added |vstolocal to the registry, which is located in the HKCU tree.
The projects is a Visual Studio 2010 project, build on TFS 2008. The installation on an Office 2010 goes well, the error only occurs when Office 2007 is on the machine.
Anything else I'm overseeing?
The solution to my experience with this issue was the one given by Joeri on the 8th July - install Visual Studio 2010 Tools for Office Runtime on the target machine.
This is an issue with the version of Visio your add-in targets versus what is installed on the client machine. AddIn is an element that is new with the 2007 versions of Office. More than likely the client is running Visio 2003.
Some times the Visual Studio 2010 Tools for Office Runtime is installed on the machine but the vsto file fails to find it. In this case try if you can manually execute the installation command line.See example below (replace X with your own drive letter, path, and file name):
"c:\Program Files\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" /Install file:///X:/XXX/XXX.vsto 

Not a valid Office Add In

I developed a new Office 2007 addin using VS 2008 and VSTO. after this I go to
Office->Excel Options->AddIns->COM AddIns and GO... If I select the .dll which I ve created I get the error
'<path>' is not a valid Office Add In.
If I run it using the Visual Studio 2008 at my development machine, it works fine and I see the add-in.
I searched so many posts but didn't get a solution.
Excel kept rejecting the Add-In, so the solution for me was doing it directly via the registry.
Save the below text as a .reg file, replace the Manifest path and FriendlyName to suit your PROJECT and double click the reg file to add the key to the Registry.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\PROJECTExcelAddIn]
"Manifest"="file:///C:\\TFS\\Pg.PROJECT\\PROJECTExcelAddIn\\Src\\PROJECTExcelAddIn\\PROJECTExcelAddIn\\bin\\Debug\\PROJECTExcelAddIn.vsto"
"FriendlyName"="PROJECTExcelAddIn"
"LoadBehavior"=dword:00000003
"Description"="PROJECTExcelAddIn - Excel add-in for PROJECT."
VSTO does not create COM Addins. You will need to install your add-in on non-development machines. The article Adding the Office Primary Interop Assemblies as a Prerequisite in your ClickOnce installer at http://blogs.msdn.com/vsto/archive/2008/05/08/adding-the-office-primary-interop-assemblies-as-a-prerequisite-in-your-clickonce-installer-mary-lee.aspx will get you started.
Actually, you'll have to publish the addin. Then, the Visual Studio will create a folder in Debug folder named app.publish folder with other folders in and, the important thing, a setup file named setup.exe.

Resources