VBA’s Long Lasting Viability

Microsoft has taken great pains over the years to try to kill VBA off. I’ve discussed some of the issues surrounding this effort in two previous posts: VBA and Office 2013 and VBA and Office 2013 (Part 2). Because of these efforts, a number of people have written to ask me about VBA and my book about it. The fact of the matter is that most of the examples in VBA for Dummies continue to work fine and VBA remains a viable development platform for applications. Microsoft’s efforts to move VBA developers to Visual Studio Tools for Office (VSTO) haven’t been as successful as Microsoft would like-mostly because most VBA developers have other careers and don’t want to learn how to use VSTO.

I do continue to provide updates for my book in the VBA for Dummies category of this blog. The latest such post discusses trigonometric calculations in VBA. As you find book issues, I’ll continue to address them in this blog. In addition, as time permits, I’ll discuss VBA issues in general and provide additional examples that relate to the content in my book. All I really need is your input at John@JohnMuellerBooks.com to know what sorts of content you’d like to see. Your e-mails help me decide which issues are most important to you, so please do write when you see a particular need.

Of course, the biggest question about VBA is the one I haven’t answered yet. Some people have wondered whether VBA is still a viable language for new development. The fact that even Microsoft has provided updated macros for VBA should tell you something. If there were no interest in new development, you can be sure that Microsoft wouldn’t waste time in posting macros for Office 2013. In fact, a Google search shows 122,000 hits for sites that have updated their VBA information in the last year. That’s a lot of interest in a language that Microsoft has tried so hard to kill off.

I still see VBA as the language to use when you have any sort of Office automation need-VSTO is a better choice when you actually want to extend Office functionality or define new behaviors (work that full-fledged developers normally perform). It’s incredibly easy to use and most people can learn to use the basic features quite quickly. In fact, because it’s interpreted, VBA makes a great way for people to start learning basic programming principles. Plus you can take a number of courses to help further develop understanding of this subject (click here for an example of one such course).

The only caveat for today is to ensure that your code doesn’t have any compatibility issues, especially if you plan to use your VBA macros with Office 365. There is a lot of old code out there that might not work with newer versions of Office. With this in mind, Microsoft has created the Office Code Compatibility Inspector (OCCI). Make sure you download as use this tool to check your code.


VBA and Office 2013

First, the good news about Office 2013. Despite Microsoft’s best efforts to kill VBA off, it still hasn’t managed to do so. In running the various examples supplied with VBA for Dummies, I find that they all apparently run the same as they do for Office 2010. Consequently, you should still be able to follow the examples in my book without too much trouble. The Ribbon definitely will cause the same amount of trouble as it always has and you should read the posts in the VBA for Dummies category of this blog when working through the book. Remember that these assumptions are based on the current Office 2013 Customer Preview and not on a released product. I also tested the examples on Windows 7, rather than Windows 8. If anyone encounters issues working through the VBA for Dummies examples, I’d very much like to hear about them at John@JohnMuellerBooks.com.

Second, the bad news (isn’t there always some bad news). I’ve been reading about some of the experiences other people have had with Office 2013. In fact, I’ve been trying to test some of these concerns as I work with Office 2013 because I’m almost certain that some of you will write me about them. Most of the issues seem to run on the esoteric side. For example, a number of people are reporting that Office 2013 has problems with animations that are supplied as part of a VBA macro. The issue seems to be one of timing, which is probably one of the more difficult aspects of a VBA macro to troubleshoot. My advice with these sorts of issues is to focus on the macro output for right now. When the inputs and outputs work as expected, the user is generally happy. Yes, features such as animations add pizzazz, but they don’t necessarily help users perform useful work. Even so, Microsoft will probably fix a few of these issues before product release. To obtain the best help with your particular question, check out the Microsoft Office forum.

Third, the surprise news is that Microsoft is even mentioning VBA in some of the Office 2013 documentation for developers. You can find an overview of developer information at What’s new for Office 2013 developers. Many of the changes you’ll find are quite technical (such as working with the new DataModel object model). I was also quite happy to see that there is a new user interface (a task pane) for creating the XML mappings required for content controls, so you don’t have to resort to using any of those weird file manipulation methods of the past. Once Office 2013 is released, I’ll cover a few of these topics in my blog. Make sure you check out the pages for the individual applications as well:

It’ll be interesting to see how users react to the modified Office interface. My thought is that Microsoft is trying to reduce the power consumption of its applications by reducing the complexity of the user interface. However, no one at Microsoft is really saying much except that the older Aero interface looks dated and cheesy.

You’ll also want to remember that Microsoft is maintaining VBA, not really enriching it in any significant way. If Microsoft had its way, VBA would disappear with the flash of a magician’s hand. Unfortunately for Microsoft, far too many people still use VBA to create productive applications. The Visual Studio Tools for Office (VSTO) add-on has attracted a lot of attention from professional developers, but it’s far too complex for the typical office manager to use. The new focus is on something called Apps for Office. The overview for this new technology doesn’t fill me with a lot of hope that it’ll replace VBA anytime soon, but I’d love to hear your opinion about it.

For better or for worse, you’ll soon be finding yourself supporting another version of Office. In this case, you’ll likely find that VBA takes a few more hits in the compatibility zone. Microsoft is pushing hard to get developers to use anything other than VBA and developers seem equally convinced that VBA is still the right choice. I support using the right tool for the job. As long as VBA provides a simple environment for creating macros that perform useful work with a minimum of headaches, I’ll continue supporting it. In that regard, count on my continued support for VBA in Office 2013.