15

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.

bluish
  • 26,356
  • 27
  • 122
  • 180
Sachin
  • 239
  • 2
  • 3
  • 6

3 Answers3

9

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."
Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
4

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.

AMissico
  • 21,470
  • 7
  • 78
  • 106
  • This actually isn't true. VSTO does create COM AddIns. You will find the Add-Ins you create in VSTO residing in the COM Add-Ins in Microsoft Office. – Justin May 20 '14 at 21:00
  • @Justin Yes, but that is a wrapper in the VSTO run-time library created to call your CLR code. If you want your .NET Class to support COM, that is a whole other process. Do you have any references? – AMissico May 21 '14 at 05:08
2

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.

iviorel
  • 312
  • 3
  • 10
  • After spending half a day of searching, this worked. it gave me the option for where to place the `publish\` folder. in my case I am running windows 10 on Parallels through my Mac. – Cflux Jul 21 '20 at 00:55