Solved: How to get to Excel VBA code modules using VBA?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Gregor1234

Thread Starter
Joined
Jun 3, 2004
Messages
237
In MS Access you can write VBA code that allows you to manipulate the existing VBA code in standard and class modules by using the Modules collection of the application object.

In Access VBA, the Application.Modules collection contains only open modules

I am trying to do a similar same thing in Excel but with no luck.

There appears to be an undocumented Modules collection in Excel but the Modules.Count always comes back as zero. If this works the same way as in Access VBA, then none of the modules are officially "open" (including the one I'm executing).

Anyone have any experience doing this sort of thing in MS Excel VBA?

I just want to write some quick and dirty code to do some rudimentary analysis of an Excel application that was dropped on my desk. I want to do things like counting lines of code, and identifying the entry points and global declarations.

Yes, I can cut and paste all of the code into a text file and analyze that but I was looking for a more elegant solution.
 
Joined
Jul 25, 2004
Messages
5,456
I think Chip Pearson has posted every solution known to the world of Excel on his site. Between him, John Walkenbach and Debra Dalgleish, there isn't much more room to cover! LOL!
 
Joined
Oct 20, 2004
Messages
7,837
Well, just so you don't feel bad, on here we still need our Pro-Zack!...er, um.... ;)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top