Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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 PrintThe****()
Const strProcedureName As String = "PrintThe****"
End Sub

I then use these constants in my err handler.

Hope I helped you a bit
Flemming


"Nigel" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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" wrote in message
...
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 PrintThe****()
Const strProcedureName As String = "PrintThe****"
End Sub

I then use these constants in my err handler.

Hope I helped you a bit
Flemming


"Nigel" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Name of Current Macro running?

Hi Nigel

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

Cheers,
Flemming


"Nigel" wrote in message
...
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" wrote in message
...
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 PrintThe****()
Const strProcedureName As String = "PrintThe****"
End Sub

I then use these constants in my err handler.

Hope I helped you a bit
Flemming


"Nigel" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running total based upon current date ucastores Excel Worksheet Functions 5 April 10th 10 04:48 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
Running/Current time in cell? SRS New Users to Excel 6 September 28th 05 09:45 PM
Running a Sub and exiting the current one. dht Excel Programming 2 June 22nd 04 02:47 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 02:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"