+ Reply to Thread
Results 1 to 4 of 4

How to check whether a class contains a specific method?

  1. #1
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    How to check whether a class contains a specific method?

    E.g. in PHP there is a function called method_exists, for which the prototype re-written in vba syntax might look something like this:

    Please Login or Register  to view this content.
    Is it possible to perform a check such as this in Excel VBA?

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How to check whether a class contains a specific method?

    I think you must use CallByName for this:
    Please Login or Register  to view this content.
    for example. This will be for Method specifically - it will return false for any Property.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How to check whether a class contains a specific method?

    Quote Originally Posted by Izandol View Post
    I think you must use CallByName for this:
    Please Login or Register  to view this content.
    for example. This will be for Method specifically - it will return false for any Property.
    Many thanks!

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How to check whether a class contains a specific method?

    You are welcome.

    Please remember to select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Dynamically call class method
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-16-2013, 05:45 PM
  2. cut method of range class failed
    By bishoposiris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2012, 12:48 PM
  3. copy method of worksheets class
    By guss in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2011, 03:59 PM
  4. why there is error when i'm calling method in my class
    By yeekhoon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2007, 11:57 PM
  5. [SOLVED] Should Method Belong to the Class?
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2005, 05:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1