![]() |
VBA Path Confusion between Appl and Personal.xls
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 |
VBA Path Confusion between Appl and Personal.xls
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) "MWE" wrote in message ... 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 |
VBA Path Confusion between Appl and Personal.xls
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. -----Original Message----- 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) "MWE" wrote in message ... 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 . |
All times are GMT +1. The time now is 08:06 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com