• Get function or sub name

    Author
    Topic
    #351695

    Is there a way to obtain the name of the active function or sub in VBA?. This can be very useful in error handling.
    CurrentObjectName gives the name of the module, not the name of the active function or sub!
    Thanks in advance.

    Viewing 0 reply threads
    Author
    Replies
    • #509792

      I haven’t found any way but setting a constant in each routine to hold the name of the particular sub or function and then including a reference to that constant in your error handler.

      • #509795

        That was also my solution, but I did not like it. I hoped for a more elegant way to get the function name. Pity….
        Thanks for the effort.

        Bart Stam
        Software developer
        PGGM Zeist

    Viewing 0 reply threads
    Reply To: Get function or sub name

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: