Can You Read Module Names Using VBA?

R

roadkill

Is there a way to read individual VBA module names (including any user forms)
programmatically?

My basic problem is as follows: I have a set of tools that have been made
available to Project Managers. Whenever a tool is added or an update done on
an existing tool, the PM's can go to the organizer and recopy the tool module
(and sometimes a user form) to their Global file and have all the latest.
I'd like to simplify this by providing a macro that does the update for them.
Unfortunately, if the update code lies in the tool module, I'd be trying to
rewrite the module I'm executing from. One solution would be to put the
update code in a separate module. But I'd need to exclude this module from
the copy (i.e. I want the update code to copy all modules except the one
containing the update code that is running, so that any forms get copied
too). If I can programmatically check the module names, I can make sure and
copy just what should be copied.

So there you have it. Any ideas?

Thanks,
Will
 
J

Jan De Messemaeker

Hi,

To get forms and modules in the global:

for each Modul in vbe.vbprojects(1).vbcomponents
debug.print Modul.name
next

Hope this helps
 
R

roadkill

This looks like it should work. Thank you!

Jan De Messemaeker said:
Hi,

To get forms and modules in the global:

for each Modul in vbe.vbprojects(1).vbcomponents
debug.print Modul.name
next

Hope this helps
 

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