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.
Related
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.
I have created Visual studio add-in successfully.But I am confused to deploy this addin in another computers.I have go throgh the stackoverflow answers.But I did not get clear cut idea about this matter
You just need to copy YourAddIn.dll and YourAddIn.AddIn files to "c:\Users\username\Documents\Visual Studio 2012\Addins\" folder on another computer. To create an installer you can start with Wix Template For VS2012 Addin Project.
Deploying an add-in requires to copy the add-in dll(s) to some folder and create a XML .AddIn file in a predefined folder where VS can locate it where a entry of the XML file points to the add-in assembly.
For articles about the prefedined folders for .AddIn files and about creating a setup see the "Articles about installing and uninstalling" section of my web site:
http://www.visualstudioextensibility.com/articles/add-ins/
To troubleshoot problems loading add-ins see my article:
HOWTO: Troubleshooting Visual Studio and Office add-ins
Visual Studio is a 32-bit executable, so the add-in dll and dependencies must be 32-bit.
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)
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.
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