ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Aboslute path to reference macro (https://www.excelbanter.com/excel-programming/417143-aboslute-path-reference-macro.html)

daboul

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.


daboul

Aboslute path to reference macro
 
Hi,
thanks for your suggestion but I've done that and it not good enough because
of what I've explained in the second part: a workbook built using the sub in
the xla won't be compatible from a workstation to an another (the stored path
is a strange DOS path on some of the computers, and a full path on the
others).

Thanks,
David.

"Chip Pearson" wrote:

The simplest solution would be to put the XLA in the XLStart folder on each
machine. This folder is typically

C:\Program Files\Microsoft Office\Office11\XLStart

At startup, Excel opens all files in that folder.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"daboul" wrote in message
...
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.




All times are GMT +1. The time now is 12:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com