Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default name of calling routine

I suspect the answer is "you can't" but does anyone know of a way to return
the name of the routine that's called a function? Failing that, some generic
code that returns the name of the current sub or function? I'm just writing
a universal error routine and it's a pain having to send the calling
routine's name by hand each time.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default name of calling routine

Your latter comment implies you don't like:
Sub RoutineA()
'...
CallFunctionX RealParameter,"RoutineA"
'...
End Sub
Function CallFunctionX(WhatIneed,WhoCalledMe as String)
'...
'WhoCalledMe is the routine who called me in
'...
End Function
Sub AnotherGuy()
'...
CallFunctionX RealParameter,"AnotherGuy"
'...
End Sub

But aside from numbering every line and using the erl (line # function), I
don't know of a way (would be a nice thing to have -- some way to easily to
invoke the Call Stack)

Bob Umlas

"Smallweed" wrote in message
...
I suspect the answer is "you can't" but does anyone know of a way to return
the name of the routine that's called a function? Failing that, some
generic
code that returns the name of the current sub or function? I'm just
writing
a universal error routine and it's a pain having to send the calling
routine's name by hand each time.



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
Read directly a returned array in the calling routine Jean-Pierre Bidon Excel Programming 4 December 14th 05 01:40 PM
Using (what goes in here) for sub routine Wally Steadman[_4_] Excel Programming 2 December 30th 04 06:51 PM
SUB ROUTINE tokirk Excel Programming 1 January 19th 04 02:17 AM
Keep userform visible, but return control to calling routine Ryan Poth[_2_] Excel Programming 0 August 21st 03 05:28 AM
Need VBA Routine John M. Lembo Excel Programming 0 July 13th 03 01:51 AM


All times are GMT +1. The time now is 02:07 PM.

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"