Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mar 13, 2:05*pm, "Rick Rothstein"
wrote: if your AnotherMacro [...] it will only be called from within other code, then you can give it an argument and pass the calling routine's name through it. [....] Another possibility is to use a global variable to transmit the name... this method can be used with real macros as well as subroutines. Notwithstanding what I explained regarding symbol tables in general, I do agree with you that it is probably better to use one of these mechanisms instead of relying on any programming interface that VBA or the kernel might provide. In fact, for most purposes, I would not pass a name at all, except for debugging/logging purposes. Instead, I would pass a number, which the called procedure might use to alter its behavior. One benefit of relying on a number (or arbitrary string) instead of the caller's name is that procedure names have a habit of changing over time ;-). Moreover, it allows multiple callers to affect the same conditional behavior, which should be defined in a "functionally cohesive" manner independent of a caller's name. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calling a public Macro from a Private Macro | Excel Programming | |||
Calling XLA Macro from DLL. | Excel Programming | |||
calling next macro | Excel Programming | |||
Calling a macro from a key | Excel Programming | |||
Calling macro in add-in. | Excel Programming |