ExcelDNA breaking link to *.xlam addin?

114 views
Skip to first unread message

Terry Aney

unread,
Jun 24, 2016, 7:28:16 PM6/24/16
to Excel-DNA
I am using ExcelDNA to write an add-in to replace a legacy *.xlam addin.  I'm seeing some strange behavior.  There are some functions in the .xlam one, for example, 



So if I had a cell formula like =AddMonths(DOB, 10) all is good.  My new DNA addin that is replacing this function has same function but named SpecAddMonths.  So no name collisions that I can think of, but when I open Excel with both the *.xlam and DNA addins loaded, the function appears as: 

='C:\Program Files\Microsoft Office 15\root\office15\Library\BTRTools\BTR.Extensibility.Excel.xll'!GetDataConfig("is-active")

If I remove the .xll add in and reopen the file, it all works fine.  I've tried going through the file and removing the path for all the formulas while both add-ins are loaded and then save and open and I get the same problem.

Any ideas?  I know I'm replacing the old with the new so eventually I will not have both loaded at once, but I was writing a conversion function in the new one to migrate all the cell formulas correctly to the latest version so temporarily, I do need them both open.

Thanks in advance,
Terry

Govert van Drimmelen

unread,
Jun 28, 2016, 1:30:47 PM6/28/16
to Excel-DNA
Hi Terry

I don't know if there's any way to control how Excel deals with such name collisions.

I guess one could do the renaming outside Excel by directly processing the files using e.g. ClosedXML.

Else you just have to make the renaming check a bit more carefully.

Maybe someone else has another plan..?

-Govert

Terry Aney

unread,
Jun 30, 2016, 8:18:27 AM6/30/16
to Excel-DNA
Which name collisions are you referring to?  I tried to state above that I do not believe there are any name collisions.

Govert van Drimmelen

unread,
Jun 30, 2016, 12:09:01 PM6/30/16
to exce...@googlegroups.com
A function called GetDataConfig that is defined in VBA in a .xlam will be stored internally in the .xlsx different to a function with the same name from a .xll. This internal storage, which is not usually visible in the displayed formula, might be what causes Excel to behave ad you describe when opening after file that internally had the .xlam version stored, but only has the .xll version of the function displayed.

In any event, there is nothing related to this that Excel-DNA has any control over. Beyond the Excel file format documentation you'll also not find much documentation. So there's not much to on except your empirical findings.

-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

Terry Aney

unread,
Jul 4, 2016, 9:52:31 PM7/4/16
to Excel-DNA
Thanks, it turns out I discovered this 'bug' because some code of mine that was trying to actually update links was throwing exception.  After I dismissed the exception, I'd go look at the Edit-Links feature of Excel and would see the 'wrong linking'.  It turns out however, that my 'update links' was somehow doing a 'partial update' and causing the problem.  I cleaned up that code a bit to do better checks up front before attempting to change/fix the links and I no longer have this behavior displaying.

Thanks.
Reply all
Reply to author
Forward
0 new messages