VBA Companion

by Mark Trescowthick - GUI Computing

VB4 and Windows95 greet the programmer with a rousing chorus of ‘Welcome to the wonderful world of Objects’. Which is great (OLE and OCX is cool... especially remote OLE) but which imposes a severe strain : management of all those hierarchies of Objects, properties and methods that the poor programmer is suddenly, as if by magic, expected to know, use and control.

VB4 provides at least some solution (as it should) with its Object Browser addin but, frankly, it does only a small portion of the job, and that in a not particularly intuitive or useful manner. Which is why, I suppose, the good folks at Apex Software developed VBA Companion.

VBA Companion uses the registry to identify and browse all registered OLE objects on your system... be they mainstream OLE-exposed apps like Excel, ABC FlowCharter or Project, OCX Controls, your own OLE Servers or (in a nice touch) the non-VBA Word 6 or Access/Jet 2 (via Apex-supplied .OLB files).

In both 16 and 32 bit incarnations, VBA Companion requires very little in the way of system resources and is clearly developed by developers for developers. From the very straightforward interface and the ability to view objects, methods and properties in grid form or (where appropriate) in VBA code form to the nice touch of having an Always On Top option this is very much a programmer’s tool. You can also also save multiple configurations and select whether you want items copied in VBA or Word Basic format... if you think of this as Explorer for OLE Objects, you’ll have the general idea.

And, of course, everything can be copied to the clipboard. Even better is the ability to search for an occurrence of a word in an object, at the object, object group or system-wide level. Once you find what you’re looking for, you can also branch off to view the appropriate Help File. The Registry is going to be one of those love/hate relationships I fear: a beast to understand, but enormously helpful in integrating things.

VBA Companion makes very elegant use of the Registry, and also provides some extra tools that will come in handy. One I particularly see a need for is its ability to print (in very acceptable format, even including a Table of Contents) Object Documentation. Now, I can’t see why I’d bother to do that for Excel (or even part thereof) but I think it’s a wonderful way to document internally-developed objects. Just what the doctor ordered, in fact. Finally, the Copy facility doesn’t just copy - it intelligently pastes full-spec code templates.

Now for the caveats... with a lot of OLE objects, don’t try to expand the object tree, exposing every node. You’ll generate an exception sure as God made little green apples. And loading can be a wee bit on the slow side, which I guess is understandable given that the first thing VBA Companion does is suck the Registry dry of information. Still, VBA Companion is a very Windows 95 aware app, so I would recommend simply minimising it between uses.

"Surfing the Registry" is destined, I predict, to become a popular sport for programmers. VBA Companion is good at this, and could very well be the first indispensable VB4 Addin.

Written by: Mark Trescowthick
Aug 95