Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Excel Documentor to show me how the code is being executed

I have looked at several code document  vba add-ins program.
Code Documentor
Visustin v7.
What i need:

Looking for an add-in that will simply document my calls and procedures while using my add-in program.
i.e.
When the workbook opens , what procedures were called.
My useform opens:
I press buttons to call other procedures
etc...
Basically show me all the things i did while using the add-in

Thanks
fordraiders
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Debug will do some of that in that you can set a breakpoint and then look in the call stack to see the last several procedures that were executed. Fot more information on debugging see this article I wrote on the subject.

I also happen to be developing an add-in for VBA that will allow you to produce a list of any or all the procures that get executed while you are using the workbook. If you download the attached InsertProcNameVBA.txt file, store it anywhere you like, rename it as InsertProcNameVBA.dll and then go to Start|Run and type in "Regsvr32  C:<your path>\insertprocnamevba.dll" (in some versions of Windows you need to drag the dll file to the Regsvr32 program).

Then Open Excel, go to Visual Basic (Alt+f11), go to Add-ins|Add-in Manager and select "Insert Procedure Names VBA" from the list. Two new buttons will then appear. The first one will allow you to select the procedures you want to trace and the second allows you to set what you want to have happen. The default is a Debug.Print statement containing the name of the procedure.
InsertProcNameVBA.txt
Avatar of Fordraiders

ASKER

i cant detatch this file ?
What do you mean?
I cant save it..
i cant download it.
everytime i click on it it open in IE
I'm not sure what is going on but what happens for most people is that after they click on the attachment in ID: 40288421, the file is stored by their browser in whatever folder you have chosen to have your downloads sent to. You should then be able to go to that folder and the follow the instructions I gave.

What exactly did you do, step by step, that causes you to say "I cant save it"?

I have to go out for a few hours but I'll check back with you when I return.
i cant download it.
everytime i click on it it open in IE
Oh, I see. In IE I think you need to just right-click on the page an then "Save As".
it wont give me that option..but i did find the file...
http://www.vbforums.com/showthread.php?774601-Overlap-between-to-add-ins&p=4747545   
here.
Is this ok ?
hmmm...ok  loaded.
The buttons appear.
I highlight the procedure.
Click the procedure button
But nothing seems to happen when i execute he code
sorry, Feel like an idiot but....
As I said, I'm developing this add-in as we speak so I've attached an updated file.

The statements will only appear if the code gets to them.

User generated image
You need to select the button at #1, then select the procedures you want to trace in #2. When you click 'Add" the statements that you see at #3 will appear, and then if the procedures that you chose are executed, the Debug.Print statements will appear in the Immediate Window that you get to from Visual Basic by typing ctrl+g.


In order for anything to happen you must select the procedures you want to trace
InsertProcNameVBA.txt
Martin, sounds good. Can u please post the file in zip format. I have no shorcut selection for "save target as"..
weird. Just started happening. in EE
EE won't all the dll, but you can download it from MediaFire.
perfect !
on Button1

and a brief explanation on

Select "A" set code to be added to procedure ??

and please keep me posted on updates..Is there a way for that !!!
This is great ! saved me 4 hours of work in 2 min


Thanks
fordraiders
Martinliss, You should charge for this man.
This is exactly what no other program offers. !   Great  Work !
fordraiders
The "A" button is the one shown in this picture
User generated image
and when you select it if you leave it at the default (Debug.Print) you'll produce Debug.Print statements like you've probably already seen. If you select the second option you'll produce statements like these
User generated image
Where you could use PROC_NAME for example as a value to pass to some common error handler so you know where the error occurred. The 3rd option is open to your imagination.

I most likely won't remember to update you but if you check my profile once in while you'll find a link to an article I wrote concerning a similar add-in for VB6. When I'm finished with the VBA version I'll update that article.
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
np settled and thanks for the information.
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
I remembered!

Save your old dll or txt file but I've republished my article.
Thanks very very much...Its working great !
martinless,
Did u update mediafie with the new dll.

I just can download the .txt file for some reason.

Thanks
fordraiders
martinless, Its something in firefox apparently.  Saved it from IE.

Thanks'