Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract Macros from Excel Files

Status
Not open for further replies.

vbSun

Programmer
Dec 9, 2002
504
US
I have a number of excel work books which has an number of Macros. I need to document the Macros and extract all macro source code and Forumulae on to a single document.

Is this possible by Automation? If yes, could you please tell me how?

Thanks in advance!

 
First, you need to enable "Trust programmatic access to VB Project" (Excel 2007 > Ribbon > Developer tab > Macro Security > Macro Settings, or Excel 2003 > Tools > Macro > Security > Trusted Publishers tab).

Then you need to (well, you don't need to, but it will make your life easier) add a reference to "Microsoft Visual Basic for Applications Extensibility" to your project.

Then you can look at the methods and properties available to the [blue][tt]Workbook.VBProject[/tt][/blue]. It is usable but it's rather like working with a text file.



Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top