getting a list of all VBA macros

  • Thread starter Patrick Schmid [MVP]
  • Start date
P

Patrick Schmid [MVP]

How do I get a list of all VBA macros programmatically (either in Word,
Excel, PPT or Access)? Essentially I am looking for the same thing that
you see in the 2007 apps when you go into Options, Customize, Macros.

Thanks,

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
A

Andy Pope

Hi Patrick,

I think you have to use the VBA Extensibility library to parse the code.
Rob Bovey has a code documentor which does a little more than you need
as not all routines are displayed in the Macros dialog.

http://www.appspro.com/Utilities/Documentor.htm

Cheers
Andy
How do I get a list of all VBA macros programmatically (either in Word,
Excel, PPT or Access)? Essentially I am looking for the same thing that
you see in the 2007 apps when you go into Options, Customize, Macros.

Thanks,

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
P

Patrick Schmid [MVP]

Thanks Andy!
It seems MS has put a security hurdle in the way though :( (The trust
access to VBA OM security setting that is off by default).
Wishing life could be easier...*sigh*

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed


Hi Patrick,

I think you have to use the VBA Extensibility library to parse the code.
Rob Bovey has a code documentor which does a little more than you need
as not all routines are displayed in the Macros dialog.

http://www.appspro.com/Utilities/Documentor.htm

Cheers
Andy
How do I get a list of all VBA macros programmatically (either in Word,
Excel, PPT or Access)? Essentially I am looking for the same thing that
you see in the 2007 apps when you go into Options, Customize, Macros.

Thanks,

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
P

Patrick Schmid [MVP]

Thanks Chirag,
I'll look into it!

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

Hi Patrick,

The following link to my website should help you get started. Though its for
PowerPoint, it should apply to all Office products that support VBComponents
object.

List Macros in Presentation:
http://officeone.mvps.org/vba/list_macros_in_ppt.html

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Patrick Schmid said:
How do I get a list of all VBA macros programmatically (either in Word,
Excel, PPT or Access)? Essentially I am looking for the same thing that
you see in the 2007 apps when you go into Options, Customize, Macros.

Thanks,

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
J

Jonathan West

Patrick Schmid said:
How do I get a list of all VBA macros programmatically (either in Word,
Excel, PPT or Access)? Essentially I am looking for the same thing that
you see in the 2007 apps when you go into Options, Customize, Macros.

In Word at least, I don't think you can unless access to the VBA project is
trusted. Even then, you can only do this from within the same template, or
from outside if the template has not had its VBA project protected for
viewing.

Back in the old days of Word 95, you could get the list of macros, but that
changed with the move to VBA in Word 97, and we never got the feature back
again.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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