PDA

View Full Version : [SOLVED:] Place a subroutine name in a var



Tezzies
09-03-2008, 06:13 AM
I would me most grateful if anyone could help me with the following-----

Place a subroutine name in a variable.

ie the sub I am currently in.

In case you are wondering why its so I can populate my error handling msgbox.

Many thanks

Bob Phillips
09-03-2008, 06:28 AM
There is no built-in functionality, you have to load it yourself in code


Sub myProc(....
procName = "myProc"
...


I have some code that I could adapt to run through the activeproject and set them all up if you want me to cut it.

Tezzies
09-03-2008, 06:56 AM
Thanks for the quick reply; you have confirmed my suspicions on this one. I have about a hundred subs to do and it would have saved some time. A copy of that code you mentioned would be great


Many thanks

Bob Phillips
09-03-2008, 07:06 AM
Okay, but it will be at least a few hours before it is ready.

Bob Phillips
09-03-2008, 09:56 AM
I had to wrap the code in a workbook so as to build a VBE toolbar from which you can launch the code.

Open the workbook, goto the VBIDE, select the project that you want to add the code to, and then click the toolbar button.

Tezzies
09-03-2008, 12:05 PM
Brilliant Xld, thanks for your time and effort on this one

Cheers