Attribute statements in VBA

If you’ve ever opened a VBA code file with a text editor, you’ve probably noticed the “attribute” statements at the start of the file. Even though you cannot modify these in the VBA editor, they allow you to add some spice to your VBA code.

Things you can do with the attributes are;

  • Document your code, to browse it with the object browser
  • Add ‘Default’ properties to classes
  • Add help-context to your code

Export your code file and open it with a text editor to make the attribute statement visible. After modifying them, import them back into your project.

A good description of the attributes is hard to find, but here’s one that covers them all; VBA attribute description. Detailed instructions on how to¬†work with the attributes¬†can be found on Chip Pearsons excellent Excel site.

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Subscribe without commenting