PDA

View Full Version : Help with Embedded Add-In Links in a Spreadsheet



Spiff
09-24-2008, 01:23 PM
This has probably been asked before, but...

I've created an Excel Add-In that allows me to do linear or cubic spline interpolation of one- or two-dimensional tables of data. I've found, however, when the spreadsheet is moved to another computer that every occurrence of the add-in also includes the drive and pathname to the add-in of my computer. How can I get the Excel spreadsheet to either automatically carry and install the add-in on the new computer, or see the already installed add-in on the new computer without trying to link back to my computer?

Help! :banghead:

Bob Phillips
09-24-2008, 02:23 PM
Take a look here http://www.jkp-ads.com/Articles/FixLinks2UDF.asp

JWhite
09-25-2008, 09:14 AM
Wow! That's brilliant. Thanks so much for the link. I just ran into this problem for the first time two weeks ago. It's only a problem in two cases, as far as I know. First, if one person has created a workbook using my UDF's and then passes the workbook to a second person and, second, if the add-in has moved since the person originally created the workbook.

Fortunately we don't have many people using it right now and this was discovered during testing. I had been installing the add-in in "Application.UserLibraryPath" but we're switching to an InstallShield install which will create a "Program Files" directory for our add-in so the path will be the same for everyone. Still, these routines would make it almost bullet-proof.

One thing I didn't understand is where he replaces the xlExcelLinks with the reference to the new location. Doesn't that correct all the formulas at the same time? What's the purpose of replacing the xlExcelLink if he still has to do a replace on each formula? He said he did it "just to be safe".

Bob Phillips
09-25-2008, 09:48 AM
I would guess that Jan Karel hasn't actually experienced a problem with it, but sees a potential problem, so does it 'just to be safe'.

JWhite
09-25-2008, 10:45 AM
OK. Thanks. The more I think about it the more I think I'd better include this code. We're working on a commercial product and we're doing our best to minimize support calls - in advance. I can see where a company might initially install the add-in in the program files directory on each PC and then later decide to move it to a server. If that happened, all the formulas previously created would stop working.