Save original workbook name, referenced by macros in other books?
Sounds like you are playing 3 Card Monty.
If you figure out how to describe your situation possibly someone can make a
meaningful solution.
--
Regards,
Tom Ogilvy
"danwPlanet" wrote in message
oups.com...
Book1 is in an In-Production LAN directory I can't edit except through
someone else, and to test the new macro I want the new code to be in
Book2, which is in a folder where I can freely edit and test it. And I
want it to be initiated from Book1, because the user has only Read-Only
access to my directory.
(I guess this is really just an admission that we don't have a
Test-vs-Production staging system for Excel where I work, but fixing
that would be a long-term solution, and I'm of course looking for a
strategy I can use today.)
* * * *
Even if that were not the case, isn't it still true that the menus mess
it up? If the user happens to have several Excel windows open, they
all show the same set of menus. If they select a menu item while some
Book3 is open, then Activeworkbook will be Book3, the wrong one, not
so? When a menu runs a macro, is there some way to find out the name
of the workbook that contains the macro?
If the menu problem is solved, I think I can take advantage of the fact
that opening Book2 and then immediately HIDING it will re-activate the
previous workbook...
* * * *
Another thought is to have the opening of Book1 automatically open
Book2 and store the info in Book2. (I'm willing to hard-code the name
of Book2.) But the new macro will rarely be used, so I'd hate to
resort to opening a seldom-used workbook every time. Then again, after
this is all thoroughly tested and in use for a while, I do plan to move
it all into Book1.
|