SmittyPro - Witticisms, Help, Tutorials and More

VB HTML Maker Update

written by Zack

Post to Twitter Post to Facebook Post to Google Buzz Post to LinkedIn Post to Technorati

When I first starting really getting into VBA, it was pretty invaluable to me to be able to read over my code. And over and over and over my code again. And again. As well as others code. This really helped me learn the syntax and flow. An add-in which was great, which I can’t remember the name of, allowed me to print out my VBA code as an HTML file, so I could view the code as it looked in the VBIDE. This was great! I could now review my code and keep it as a hard copy for backup!

In the meantime, I have done a lot of posting to forums of sorts. One of the forums in particular is Mr This board utilizes vBulletin software and is laid out very nicely. There are a few add-ins to help you post things to make it present nicely when viewed. Some of these add-ins were (a list of which can be found here) Colo’s HTMLMaker, Excel Jeanie 4, ASAP Utilities, etc. Among these was the VBHTMLMaker add-in, which let you post your VBA code to the forum and have it present as it did in the IDE. Awesome!

So now to my point. A few years ago I asked Juan Pablo Gonz├ílez, original developer of the VBHTMLMaker add-in (amongst other collaborators) if I could amend his add-in. What I wanted to do was add an option to save the HTML generated code into an HTML file. Easy, portable, documented, and printable! He graciously agreed and that’s where I sat until yesterday. I made excuses that I didn’t have time, but more or less I didn’t make it a priority. I finally had enough with my procrastination and I added the code yesterday, tested today, and am now uploading to share with the world.

There is also some minor modifications to keep it as the font you have set in your VBE options. To get this value we need to read the registry, which retains the font name (among properties). A portion of the code was graciously utilized from Dev Ashish and Terry Kreft. This is used by the following code:

‘    Txt = IIf(HTML, ““, “[face=Courier New]”)
    Txt = IIf(HTML, ““, “[face=Courier New]”)

If you do not want to use such code and want it in Courier New every time, uncomment the commented line and take out the other. Unfortunately this only works for HTML and not BB code. The new file is named VBHTMLMaker2007, but does not utilize the Ribbon in any way. So if you have a need or desire to save your VBA as an HTML file for whatever reason, this file has the amended code as such. Enjoy!



Zack Barresse

Post to Twitter Post to Facebook Post to Google Buzz Post to LinkedIn Post to Technorati

One Response to “VB HTML Maker Update”

  1. SamT

    Thank you, Zack. Now if we could just get VBAX to allow it.

Leave a Comment - Here's your chance to speak.(eMail will not be published)

Separate individual tags by commas

Before you post, please prove you are sentient.

What is 9 multiplied by 7?

Microsoft MVP


Join In

Tag Cloud

Great Links


Welcome to, your one-stop for solutions concerning anything from beginner to extremely advanced Microsoft Excel issues and programming. Topics covered include Excel, Access, VBA, and (every now and then) some amazing observations or "Smitticisms" that might dumbfound you and send ripples of excitement or intrigue around the world.



RSS Top Stories from CNN

Vistor Counter for SmittyPro's Blog