UDFs not working into existing Excel Add-in

Add-in Express™ Support Service
That's what is more important than anything else

UDFs not working into existing Excel Add-in
UDF from new XLL Module into existing COM Add-in does not work 
avelinoruiz




Posts: 11
Joined: 2009-09-15
Hello,

I am adding a new XLL Add-in Module into our existing Excel Add-in project, with a simple function that returns a string.

However after registering this ADX project, the function does not show in Excel.

I created a new COM Excel Add-in project, then added the XLL Add-in module and it worked.

What settings or files would you recommend me to look into in order to find out what is wrong with my existing project? I know the new XLL class is added into the manifest.

Thank you,
Posted 15 Sep, 2009 10:56:23 Top
avelinoruiz




Posts: 11
Joined: 2009-09-15
Hi again,

I found the cause: the new manifest wasn't being copied to the bin/Debug folder. That's why a new project COM w/XLL would work while an existing one with an additional XLL Addin wouldn't.

Why is the manifest configured to not being copied to the Output Directory by the way? I would like to know of any implications before I set the "Copy to Output Directory" option to Copy if newer/Copy Always.

Thanks.
Posted 15 Sep, 2009 17:46:42 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Avelinoriuz,

I would like to know of any implications before I set the "Copy to Output Directory" option to Copy if newer/Copy Always.


I like your approach very much. Also, it gave me some ideas on how to pdate the manual so that other customers won't run into the same problem. Thank you.

Both adxloader.dll and adxloader.dll.manifest are essential for Add-in Express based add-ins: if these files are missing, the add-in will not load. That's why we don't rely on the value of the Copy to Output Directory property and copy these files ourselves. Currently, they are copied to the output directory when you register the project.

Registering is essential as well. If you don't register your project, Office doesn't know anything about your add-in. I assume your COM add-in is already registered. But COM add-ins and XLL add-ins register in different ways. That's why copying the manifest manually will not help. To solve the problem, you need to register your project once again. For your COM add-in this will not change anything. For your XLL add-in, this will write the essential registration information to the registry and copy the manifest to the output directory.

Does it work now?


Andrei Smolin
Add-in Express Team Leader
Posted 16 Sep, 2009 05:25:23 Top
Avelino Ruiz




Posts: 11
Joined: 2009-09-15
Hi Andrei,

Yes, I repeated the same exercise and it is working as expected. Actually I noticed that the manifest file is copied either when registering or unregistering.

Thank you for your help.

Avelino
Posted 16 Sep, 2009 12:20:48 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Avelino,

Thank you for letting me know.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Sep, 2009 02:00:42 Top
Avelino Ruiz




Posts: 11
Joined: 2009-09-15
Hi Andrei,

I would like to share more information regarding this issue so that it helps other developers to avoid the same problems:

First of all, we are using TFS Source control, so when I first added the new XLL module to an existing COM Add-in project, it didn't check out the adxloader.dll.manifest under the Loader folder.

What I had to do was to check out this file manually and then add the XLL module. This way, the manifest is modified correctly.

The second issue was that the adxloader.dll is also saved in the Loader folder. When I add a new XLL module and register the project, it should be replaced by a adxloader.MyAppName.dll file. Instead it copies both DLLs to the bin folder causing the Excel application to crash.

What I had to do is to manually delete the adxloader.dll from the Loader folder (and the bin folder) so that it doesn't get copied to the bin folder each time I register.

I believe that this should be noted in your documentation.

Thanks,

Avelino Ruiz
Posted 25 Sep, 2009 13:03:53 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Avelino,

Thank you very much for your great post!


Andrei Smolin
Add-in Express Team Leader
Posted 26 Sep, 2009 06:37:45 Top