+ Reply to Thread
Results 1 to 5 of 5

Name of Current Macro running?

  1. #1
    Nigel
    Guest

    Name of Current Macro running?

    I am developing a error handling routine and wish to note the name of the
    module and sub that was running when the error occurs.

    Is this available ?

    --
    Cheers
    Nigel





  2. #2
    Norman Jones
    Guest

    Re: Name of Current Macro running?

    Hi Nigel,

    I think that you would need to add this information to your routines.

    MZ Tools adds a button to the VBE which inserts an error handler that
    includes the routine and module names.

    MZ tools has many other nice features and may be downloaded at:

    http://www.mztools.com/


    ---
    Regards,
    Norman



    "Nigel" <[email protected]> wrote in message
    news:[email protected]...
    >I am developing a error handling routine and wish to note the name of the
    > module and sub that was running when the error occurs.
    >
    > Is this available ?
    >
    > --
    > Cheers
    > Nigel
    >
    >
    >
    >




  3. #3
    Flemming Dahl
    Guest

    Re: Name of Current Macro running?

    Hi Nigel

    What I do is to make a private const in each module and in each procedure...
    like this

    Private Const mstrModuleName As String = "modPrintFeatures"

    Public Sub PrintTheShit()
    Const strProcedureName As String = "PrintTheShit"
    End Sub

    I then use these constants in my err handler.

    Hope I helped you a bit
    Flemming


    "Nigel" <[email protected]> wrote in message
    news:[email protected]...
    >I am developing a error handling routine and wish to note the name of the
    > module and sub that was running when the error occurs.
    >
    > Is this available ?
    >
    > --
    > Cheers
    > Nigel
    >
    >
    >
    >




  4. #4
    Nigel
    Guest

    Re: Name of Current Macro running?

    Thanks for the tips. I had considered the addition of a constant that would
    be used in the err.handler but it seemed a bit onerous to have to set the
    value up each time and maintain it, but if that is the only way I guess I
    have to pursue it.

    I'll take a look at MZ tools and see if it fits.

    Thanks again

    --
    Cheers
    Nigel



    "Flemming Dahl" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Nigel
    >
    > What I do is to make a private const in each module and in each

    procedure...
    > like this
    >
    > Private Const mstrModuleName As String = "modPrintFeatures"
    >
    > Public Sub PrintTheShit()
    > Const strProcedureName As String = "PrintTheShit"
    > End Sub
    >
    > I then use these constants in my err handler.
    >
    > Hope I helped you a bit
    > Flemming
    >
    >
    > "Nigel" <[email protected]> wrote in message
    > news:[email protected]...
    > >I am developing a error handling routine and wish to note the name of the
    > > module and sub that was running when the error occurs.
    > >
    > > Is this available ?
    > >
    > > --
    > > Cheers
    > > Nigel
    > >
    > >
    > >
    > >

    >
    >




  5. #5
    Flemming Dahl
    Guest

    Re: Name of Current Macro running?

    Hi Nigel

    I belive that there are more ways - this is just how I do it.

    Cheers,
    Flemming


    "Nigel" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for the tips. I had considered the addition of a constant that
    > would
    > be used in the err.handler but it seemed a bit onerous to have to set the
    > value up each time and maintain it, but if that is the only way I guess I
    > have to pursue it.
    >
    > I'll take a look at MZ tools and see if it fits.
    >
    > Thanks again
    >
    > --
    > Cheers
    > Nigel
    >
    >
    >
    > "Flemming Dahl" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Nigel
    >>
    >> What I do is to make a private const in each module and in each

    > procedure...
    >> like this
    >>
    >> Private Const mstrModuleName As String = "modPrintFeatures"
    >>
    >> Public Sub PrintTheShit()
    >> Const strProcedureName As String = "PrintTheShit"
    >> End Sub
    >>
    >> I then use these constants in my err handler.
    >>
    >> Hope I helped you a bit
    >> Flemming
    >>
    >>
    >> "Nigel" <[email protected]> wrote in message
    >> news:[email protected]...
    >> >I am developing a error handling routine and wish to note the name of
    >> >the
    >> > module and sub that was running when the error occurs.
    >> >
    >> > Is this available ?
    >> >
    >> > --
    >> > Cheers
    >> > Nigel
    >> >
    >> >
    >> >
    >> >

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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