VBA Path Confusion between Appl and Personal.xls

  • Thread starter Thread starter MWE
  • Start date Start date
M

MWE

I am running Excel2000 under WindowsXP. I have a half
dozen VB libraries in my Personal.xls file. The subs in
these libraries are referenced by dozens of Excel
applications. In some of these subroutines, there is code
that uses "path" data, e.g., ThisWorkbook.Path, to build
fully qualified paths to target directories for subsequent
use. Sub "B4" in library "B" ("B" is contained in
Personal.xls) has some of this path code.

When appl "A" calls sub "B4", the path that is returned is
not the location of "A" but the location of Personal.xls.
Is there a way to have a general routine in library "B"
that will fetch the path (location) of the calling
application?

Any help would be greatly appreciated.

Thanks
 
Is it as simple as ActiveWorkbook.Path instead of ThisWorkbook.Path?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
No; the problem remains.

There seems to be some underlying problem in doing this
cross application reference. Everything gets amazingly
screwed up. For example, I build several menus using a
general purpose menu building routine that pulls
information out of a tab in the base application ("A").
If the menu building occurs after the "cross reference",
the menus are fine and the macro references are A!
macroname. If the menu building occurs after the cross
referencing, the menus are built, but the macro references
are now Personal.xls!macroname.
 
Back
Top