… is the name of a Stackoverflow thread that sends a steady trickle of visitors here (thanks to a link posted by Charles Williams of FastExcel). On a similar theme, Smurf on Spreadsheets has a post entitled “What’s so good about VBA?” that has just celebrated its fifth birthday, and has also recently attracted a comment reading “don’t learn VBA”, which links to a blog post entitled “Losing touch… or why Excel and VBA won’t cut it any more“.
Since all these discussions have generated many comments that are at best misleading and often outright wrong, I thought I would add my perspective.
The first comment from Stackoverflow says that VBA is a “legacy language”. No, it isn’t. A legacy language is one that has been superseded by others which provide better functionality, but is still used because applications written in the old language are still in use. This isn’t the case with VBA. Spreadsheets remain by far the most common application for number processing of all types, Excel remains by far the most widely used spreadsheet, and VBA is the only language tightly bound into the Excel object model, that allows both expert and non-expert programmers (and those in between) to greatly extend the scope and power of Excel with the minimum of fuss.
Further down the page at Stackoverflow there are some good comments about the sort of thing that VBA is good for, but my favourite summary was from Harlan Grove at the Smurf discussion:
Poor analogy, trowel vs backhoe.
Better analogy would be people who use a pickup truck for their job and choose to maintain the truck’s engine themselves. VBA is a 1958 Ford engine for which you need a full set of socket wrenches and maybe a hammer. VSTO is a 2009 Ford engine for which you need a year’s pay to buy all the electronic diagnostic gear.
If you use the additional stuff for the 2009 Ford, your engine will run more efficiently. But if your day job isn’t being a mechanic, is it worth the time & effort learning to use it?
Actually this is where my analogy breaks down. VSTO solutions even when used well aren’t necessarily more efficient than pure VBA. And the analogy breaks down further because truck engines are a lot more standardized than the different .Net versions.
So that’s what VBA is good for. It’s the ute of computer programs (a ute is a pick-up truck, for non-Australians). It might not always be the best vehicle for the job (although often it is), but it gets the job done, and you don’t need a special licence to drive it.
What do you think? Is Excel+VBA still worth learning, or has it had its day?