Aboslute path to reference macro
Hi,
I have an 'xla' file containing all my macros, when I open this file using
Excel, I can insert a formula using a sub in my xla file (let's say =F(1)).
It's working fine.
I save this workbook and pass it to a colleague who copy it into a directory
where he has also my 'xla' file.
1 - if the directory containing the 'xla' file is not exactly the same on my
colleague's computer, opening the workbook will fail because Excel is not
able to find the 'xla' containing the sub '=F(...)', even if this macro file
is in the same directory than the workbook and Excel has been launched by
double clicking of the macro file. Excel is using an absolute path to
reference the call to xla file and it prevent me from using it that way, if
it were using a relative path it would be ok. Do you know a workaround for
that ? A way to make it store a relative path ?
2 - so, as a workaround I told every one to use the same path I was using,
let's say 'c:\program files\MyAddin\MyMacros.xla' so that everyone can create
and exchange workbook using the macro in the exact same directory. But a
another issue appeared: some computers store the path in DOS format
('c:\progra~1\MyAddin\MyMacros.xla') and other store the full path
('c:\program files\MyAddin\MyMacros.xla') but these two kind of files are not
compatible! It a little bit complicated because some users are connected
through Terminal Server, others are working on WorkStation ...
I'm stuck so if anyone has an ideas, it would be greatly appreciated.
David.
|