Solved

is there a utility that makes it easier to see all the macros in a vba module like an explorer or tree

Posted on 2013-01-28
11
192 Views
Last Modified: 2013-01-28
years a go I found this utility for excel vba writing that showed all the macros in a module in a tree and made it real easy to collect snippets of code but I can't find it. Is there such a program for ms word 201
0
Comment
Question by:Dov_B
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 200 total points
ID: 38826592
Not all code can be displayed as a simple tree. Many procedures can be called from more than one place, so there would be duplication. Also code can be recursive.

Generally flow charts are used to portray the links between procedures.

To write your own, you would need to use the code in the Microsoft Visual Basic for Applications Extensibility library.

Otherwise try Googling for 'flow chart from VBA code'.
0
 

Author Comment

by:Dov_B
ID: 38826850
Thanks Grahamskan you have come to my rescue so many times!
But there is a program that give explorer like tree like lists of macros in a module which I finaly found but with one small problem they want $100 which I cannot afford
I don't need a flow chart of subroutine and function that call each other rather a simple list of vba macros that reside in a particular module
where can I find either a free or very cheap tool that does that or perhaps code that will list the names of all the macros in a module
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38826860
Can you post a link to the utility, so that we can try to work out/guess what it does?
0
[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

 

Author Comment

by:Dov_B
ID: 38826869
0
 

Author Comment

by:Dov_B
ID: 38826871
0
 
LVL 21

Assisted Solution

by:EricFletcher
EricFletcher earned 200 total points
ID: 38827015
If you want a general case solution this may not be applicable, but to get a formatted list of all Subs and Functions, you could just open the module and copy it. Then open a new Word document and paste.

You can make it more useful by using Find and Replace to tag the "Sub" and "Function" lines as heading levels. That would make the names stand out better (bold, extra space, etc.), but also it would allow you to build a table of contents to show a summary of the contents.

I've done this over the years to build up a library of code snippets going back to WordBasic days.
0
 
LVL 59

Assisted Solution

by:Chris Bottomley
Chris Bottomley earned 100 total points
ID: 38827285
Whilst it does not address the calls, see http://msdn.microsoft.com/en-us/library/office/dd890502(v=office.11).aspx for some code (excel but adapts to word easily enough) to list all the subs.

Chris
0
 

Author Comment

by:Dov_B
ID: 38827298
Dear Eric how do I go about building a table of contents its a new concept for me
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 200 total points
ID: 38827327
There's a button at the left hand end of the References tab on the Ribbon
0
 
LVL 21

Accepted Solution

by:
EricFletcher earned 200 total points
ID: 38827428
After you paste all of the code in from a module, open the Find and Replace dialog (Ctrl-H) and click the "More >>>" button.

In the Find what box, type "Sub " (that's S u b space without the quotes). In the Replace with box, type the same thing, but then click the Format button and choose Style. Within the style list, choose "Heading 1". This tells Word to look for any "Sub " and replace it with the same thing but also to add the Heading 1 style to it. Click Replace All.

Now all your Subs will have the Heading 1 style. You can repeat for Functions, and if you choose, make them a different style (say Heading 2).

To create the table of contents, move to the start of the new document (Ctrl-Home) and choose the top option of the References ribbon's "Table of Contents" button (far left). This will insert a default ToC showing you the name of each Sub with the page number. If you have used Heading 2 for the Functions, they will be listed as well. You can modify the ToC by editing the TOC field code, but this is probably sufficient for most purposes.
0
 

Author Closing Comment

by:Dov_B
ID: 38827844
Thanks as always you guys are angels! May you be blessed with everything Good!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question