One way to do this is to have a long list of
If name = "xxxnn" then
xxxnn
ElseIf name = "xxxny" then xxxny
. . .
Endif
statements. Is it possible in VB to call a sub using a variable that
contains the sub's name? Something like:
name = "xxxnn"
IndirectCall name
Or some other technique?
>Is it possible in VB to call a sub using a variable that
>contains the sub's name? Something like:
>name = "xxxnn"
>IndirectCall name
>
>Or some other technique?
Lookup "CallByName" (VB6 only), that should do what you're looking for.
Not exactly a function pointer, but effectively the same thing.
"Wolfgang Enzinger" <usenet...@temporaryforwarding.com> wrote in message
news:h272k5tdalnui5tkd...@4ax.com...
"Nobody" <nob...@nobody.com> wrote in message
news:OmvtxONj...@TK2MSFTNGP02.phx.gbl...
--
Mike
"Renny Bosch" <non...@nospam.com> wrote in message
news:uMu84hmj...@TK2MSFTNGP04.phx.gbl...
> It's version 6.5.
That's VBA. This group deals with the full version of Visual Basic, which is
not the same thing. You should really post your VBA questions to a VBA
newsgroup, preferably one dedicated to the application you are using (Word,
Excel or whatever). However, for the record, the CallByName function, which
provides the answer to your question, does actually work okay in VBA.
Mike
Which is not surprising since the VB6 development platform uses the VBA 6.5
parser and libraries. <g>
-ralph
Renny
"Mike Williams" <Mi...@WhiskyAndCoke.com> wrote in message
news:e5CN1zqj...@TK2MSFTNGP05.phx.gbl...