How to list the variables and constant

L

Le Nordiste

Hi from Meudon (France)

Is it possible to list all the variable of one procédure ?

The goal being to check if each declare variable is actually used in
the sub or function.


Thanks in advance.

Le Nordiste ( the Northman of France obviously)
 
D

Doug Robbins - Word MVP

How about using the Edit>Find facility in the VBE.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Hi from Meudon (France)

Is it possible to list all the variable of one procédure ?

The goal being to check if each declare variable is actually used in
the sub or function.


Thanks in advance.

Le Nordiste ( the Northman of France obviously)
 
L

Le Nordiste

It's a manual solution but i want an automatic one,
in order to be able to document my procedures too.
 
D

Doug Robbins - Word MVP

Mais, what would you document in the case of a variable that was declared
but not used?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
K

Karl E. Peterson

Le said:
Is it possible to list all the variable of one procédure ?

The goal being to check if each declare variable is actually used in
the sub or function.

You might want to look at MZ-Tools, as Jonathan West suggested two threads previous
to your post.

http://www.mztools.com/v3/download.aspx

I think it /may/ be able to help here. But honestly, if you can't look at a
procedure and tell immediately, you've got more troubles than a report is going to
solve. Good luck!
 
D

David Horowitz

Bonjour...
If you really want to go the code route, as far as I know, you've got to use
the VBA Extensibility Library, which gives you access to each line of code
in your project. Then, you can do string searched for the word "Dim" and
unfortunetaly, you might then also need to look for "Public", "Private",
"Static", etc. It could get complicated. But if you really want to do it,
I'm sure you'll figure it out.
There's an article on TechTrax ezine about using the VBA Extensibility
Library. Some guy named David Horowitz wrote it. You'll start off using the
CodeModule.Lines() function.
http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=307
This also applies to your question about listing Subs and Functions two
threads back.
Good luck!
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top