CallByName for Module Sub/Function-VBForums
Results 1 to 3 of 3

Thread: CallByName for Module Sub/Function

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    1,973

    CallByName for Module Sub/Function

    Trying to eliminate a number of select/cases so that I can call the Module Sub/Functions by their Name and pass the applicable parameters.

    I have a VB5 work around for VB6 CallByName but it requires an object in the parameter set.

    ------------

    Using a string will not work (e.g. Call strModuleName)

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,369
    Syntax for CallByName
    Code:
    Result = CallByName(Object, ProcedureName, CallType, Arguments())
    You can only invoke methods and properties of the object.
    IF you want this to do more 'regular' routines, then you need to write a class module that does those 'regular' kinds of subroutines.

    In other words, move your subs off into a class module. (.CLS)

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    1,973
    Thanks for replying Jim.

    Was hoping there was a simple 1 line solution, but moving all of them into a class may be just a simple. Thanks for suggesting it.

    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.