tags:

views:

49

answers:

2

I have an XLA file that is to be deployed to a number of users in the organisation as an Excel add-in. My intention is to deploy it to a directory in the user's "documents and settings" folder in "Application Data\MyCompany". (In fact this is all working through a wrapper that copies the latest version of the XLA locally and installs it as an Excel add-in).

However, if a user creates a sheet that references a function defined in this XLA then Excel appears to store the absolute path of the XLA in the function call. Thus, if the user sends the sheet to a colleague Excel fails to resolve the function as their copy of the XLA resides at a different absolute path (as their username is part of the absolute path).

My belief up until now was the Excel "just coped" with this as long as the XLA was installed as an add-in but this does not appear to be the case.

Is it really the case that I need to enforce an identical absolute path for my add-in for all users? This is possible within a single organisation but I honestly can't believe this is true as it seriously impedes sharing of XLS files.

Thanks.

A: 

Can you specify an environment variable-based path? E.g. %APPDATA%\MyCompany

Mark Hurd
That's the way I'm thinking of going (or something very similar), however if %APPDATA% is expanded differently for different machines (different installed drives for example) then I'm faced with the same problem.I'm sure this must be a solved problem, otherwise it would be impossible to reliably distibute XLA-based Excel add-ins to the public.
John Pickup
@John So what you're saying is Excel expands the environment variable and stores the _expanded_ value in a newly saved file :-( I'd call that a __bug__.
Mark Hurd
A: 

There's no good way to do this. I put my xla files on a network share rather than locally and install them via the UNC path. That only works for me because everyone has access to the share, which may not be the case for you. Here's some other alternatives

http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/

Dick Kusleika
Thanks for link - looks like a useful resource. Surprised I didn't find it whilst Googling
John Pickup