How do I force Excel to save references to add-in functions without the path?
To clarify: I have a useful add-in which I've distributed to several of my colleagues. Some of them have access to a shared area and, in accordance with advice I've previously got from this site, they all use a version of the add-in which is stored in that common area. However, some of them do not have such access and they store the add-in on their own C: drives.
If I give somebody a workbook which references any of the add-in functions, it generally seems to save not just the reference to the function and the add-in, but also the whole path to the add-in. So when one of the users who cannot see the shared area opens the workbook, the cells containig the functions from the add-in do not work - even though they do have their own version of the add-in installed. If they look in the cells containing the functions, instead of seeing just the function name, they also see the add-in name and a complete path to it which is the path of the version to which I had a reference when the book was created.
Of course, they can easily find the spurious path and then do a search and replace to delete it. The workbook then seems to be happy to use the version of the add-in they have installed. In fact, I have even added a button to the add-in to do just this - when pressed, it looks for any cells in the entire workbook which reference the add-in and, if there is a path associated with it, it deletes it.
That's OK, but it would be better if I could simply persuade Excel not to save the explicit path reference in the first place.
Until now I have believed this was not possible - after much searching onm this forum and elsewhere - but now I know it is.
When testing the button I mentioned above, I copied a workbook, which I knew used my add-in functions, from one computer to another on a different network entirely. I then opened it, expecting to find lots of cells with the spurious path references so that I could test the stripping routine. BUT, much to my amazement, there were none! All of the add-in fucntions worked perfectly and there was no trace of any cells with the explicit path to the previous system's version of the add-in.
Clearly I have done something different when saving this workbook, but I can't for the life of me see what!
I checked in the workbook open event code to see if I had added a routine to actively search for and strip the fixed paths, but there is no such code.
OK, so I obviously have a memory which would shame a goldfish, but I would really love to know what on earth I've done here. I'd really appreciate any suggestions you guys can make.
Thanks,
Tony
To clarify: I have a useful add-in which I've distributed to several of my colleagues. Some of them have access to a shared area and, in accordance with advice I've previously got from this site, they all use a version of the add-in which is stored in that common area. However, some of them do not have such access and they store the add-in on their own C: drives.
If I give somebody a workbook which references any of the add-in functions, it generally seems to save not just the reference to the function and the add-in, but also the whole path to the add-in. So when one of the users who cannot see the shared area opens the workbook, the cells containig the functions from the add-in do not work - even though they do have their own version of the add-in installed. If they look in the cells containing the functions, instead of seeing just the function name, they also see the add-in name and a complete path to it which is the path of the version to which I had a reference when the book was created.
Of course, they can easily find the spurious path and then do a search and replace to delete it. The workbook then seems to be happy to use the version of the add-in they have installed. In fact, I have even added a button to the add-in to do just this - when pressed, it looks for any cells in the entire workbook which reference the add-in and, if there is a path associated with it, it deletes it.
That's OK, but it would be better if I could simply persuade Excel not to save the explicit path reference in the first place.
Until now I have believed this was not possible - after much searching onm this forum and elsewhere - but now I know it is.
When testing the button I mentioned above, I copied a workbook, which I knew used my add-in functions, from one computer to another on a different network entirely. I then opened it, expecting to find lots of cells with the spurious path references so that I could test the stripping routine. BUT, much to my amazement, there were none! All of the add-in fucntions worked perfectly and there was no trace of any cells with the explicit path to the previous system's version of the add-in.
Clearly I have done something different when saving this workbook, but I can't for the life of me see what!
I checked in the workbook open event code to see if I had added a routine to actively search for and strip the fixed paths, but there is no such code.
OK, so I obviously have a memory which would shame a goldfish, but I would really love to know what on earth I've done here. I'd really appreciate any suggestions you guys can make.
Thanks,
Tony