13
votes

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.

3

3 Answers

9
votes

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."
4
votes

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.

2
votes

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.