0
votes

I work on a Excel Addin in C# and my problem is present when i publish my C# Addin.

I'll explain:

I used this code: http://csharpramblings.blogspot.fr/2011/09/communicating-between-vsto-and-udfs-in.html

Which allow me to use UDF in my Addin. And it's work very well ! ... in Visual Studio 2013.

When i launch my Addin with Visual Studio i see my Addin in "COM Addins" in Excel. And my UDF in "Excel Addins" in Excel.

Then if: I publish my Addin with rightclick in the project in visual studio. I install the addin with the setup.exe generated by VS. I launch Excel => my addin works well, but my UDF doesn't work. Values of the cells are "#NAME?".

I checked in the COM Addins, my Addin is present. I checked in the Excel Addins, i don't see my UDF.

So i used RegAsm to register the Assembly of the published DLL. Now i see my UDF in the "Excel Addins" but it still doesn't work.

If anybody has an idea to help me that would be great !

I use: Windows 8.1 Pro, Visual Studio Pro 2013, Excel 2016 with Office365

Thank you in advance for your time.

1
Did you register your XLAM in Office? - Patrick Hofman
Your link doesnt seem to work. Getting the message Sorry, the page you were looking for in this blog does not exist. - Rand Random
I corrected the link. Sorry. And i don't have a XLAM file. My Addin is a dll. - Nato

1 Answers

0
votes

I finnaly found the solution !

My mistake was to use Regasm without any parameters. Now i use Regasm with the /codebase parameter, and i signed my assembly with a strong name. Because Regasm documentation says that:

Creates a Codebase entry in the registry. The Codebase entry specifies the file path for an assembly that is not installed in the global assembly cache. You should not specify this option if you will subsequently install the assembly that you are registering into the global assembly cache. The assemblyFile argument that you specify with the /codebase option must be a strong-named assembly.

Source : https://msdn.microsoft.com/fr-fr/library/tzat5yw6(v=vs.110).aspx

Now i see my UDF in Excel and they work.