Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Module / procedure name detection

Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default Module / procedure name detection

believe the variable will be lost. one solution is totransfer this data to
hidden cells or sheet

"Bony Pony" wrote:

Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Module / procedure name detection

Hi,
Thanks. Didn't answer the question though.
Regards,
Bony

"daniel" wrote:

believe the variable will be lost. one solution is totransfer this data to
hidden cells or sheet

"Bony Pony" wrote:

Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Module / procedure name detection

Did you try writing a separate procedure say WriteLog() to record the
activity to
an external file or a hidden worksheet and call that from end of each proc..

If this post helps click Yes
---------------
Jacob Skaria


"Bony Pony" wrote:

Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Module / procedure name detection

Thanks,
Didn't answer the question though.
Regards,
Bony

"Jacob Skaria" wrote:

Did you try writing a separate procedure say WriteLog() to record the
activity to
an external file or a hidden worksheet and call that from end of each proc..

If this post helps click Yes
---------------
Jacob Skaria


"Bony Pony" wrote:

Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Module / procedure name detection

1. On top of each procedure place a variable to record the starting time.
2. Below each procedure; call the function to write a log


Sub Procedure1()
dtStart = Now()

' Your code is here
strUser = Environ("Username")
duration = dateDiff("s",dtStart,Now)
Call WriteLog("ModName","Procedure1",strUser,duration)
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Bony Pony" wrote:

Thanks,
Didn't answer the question though.
Regards,
Bony

"Jacob Skaria" wrote:

Did you try writing a separate procedure say WriteLog() to record the
activity to
an external file or a hidden worksheet and call that from end of each proc..

If this post helps click Yes
---------------
Jacob Skaria


"Bony Pony" wrote:

Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Module / procedure name detection

At the top of each procedure store the procedure name then try calling a log
procedure with the name of the procedure

Dim myProcedure as string

myProcedure = "ThisProcedure"

LogProc(myProcedure)




--

Regards,
Nigel




"Bony Pony" wrote in message
...
Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Module / procedure name detection

Hi all,
Thanks for the help. I read in a Ron de Bruin post that you cannot detect
the name of a proc from within that proc. So I already used a method like
you all suggested. Many thanks!

"Nigel" wrote:

At the top of each procedure store the procedure name then try calling a log
procedure with the name of the procedure

Dim myProcedure as string

myProcedure = "ThisProcedure"

LogProc(myProcedure)




--

Regards,
Nigel




"Bony Pony" wrote in message
...
Hi all helpful people!

Is there a way to pass the executing procedure name to a variable? I want
to keep a log of the most frequently executed procedures in a workbook so
each time a proc executes, I build a little table with the Module name,
procedure name, user and procedure duration (timed seperately).

All ideas treated equally!!

Best regards and happy Spring to the North!
Bony



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
Name of Module from Procedure? Charlotte E. Excel Programming 3 August 22nd 08 08:30 AM
How to jump from a Form procedure to a Workbook or Module procedure? T. Erkson Excel Programming 4 January 25th 07 07:15 PM
get module line from erl and procedure RB Smissaert Excel Programming 7 February 17th 06 01:43 AM
Add Procedure To Module Via VBA Al Excel Programming 2 May 20th 05 10:58 PM
Lines in a Module(Procedure) Juan Melero Excel Programming 6 December 30th 03 12:38 AM


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

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

About Us

"It's about Microsoft Excel"