Peter T
1/7/2009 6:08:00 PM
> is located in a class and I am calling it
> from the very same userform ...
I don't quite follow but if the code is not in the class/userform that
contains the procedures, change 'Me' to an object reference that refers to
the class, eg
CallByName cls, sProc, VbMethod
where 'cls' refers to the class that contains the proc's
However if you are calling in the same class or userform as the procuderes,
indeed use the 'Me' keyword to refer to the class/userform
CallByName Me, sProc, VbMethod
Regards,
Peter T
PS yes, use the CallByName method if you need to call procedures in class or
userform, App.Run method wouldn't work
"Carim" <carim007@yahoo.com> wrote in message
news:383f777c-d594-4001-98bc-cfc1d23b415c@w39g2000prb.googlegroups.com...
> Peter,
>
> As a matter of fact, the procedure : Private Sub ButtonGroup_Click()
> is located in a class and I am calling it
> from the very same userform ...
> and in one instance, it has to call itself i.e. a CommandButton Click
> will trigger automatically the next
> CommandButton Click ...
> Should I use your recommendation :
> sProc = "CommandButton" & i & "_Click"
> CallByName Me, sProc, VbMethod
>
> Thanks again for your precious help
> Cheers
> Carim