In a previous post, I threw out a little quip about VBA going away. Based on some of the comments, I should clarify that remark.
First, I have no special or inside knowledge. Microsoft has said publicly that VBA will stay in Office for the foreseeable future and I believe that is true.
A few nits to pick: I doubt they really look past the next version, however, so the foreseeable future is really just a few years. Also, “staying in Office”, to quote myself, can mean a lot of things. XLM macros are still in Excel, but would you consider that macro language alive or dead?
Let me be more specific about my prediction. Remember this is pure speculation. I predict by version 15 (two versions from 2007) that changes to the UI will not be updated in the object model that Excel exposes to VBA. When they add embedded YouTube videos in Excel cells, you won’t be able to modify them programmatically. Further, I predict that VSTO, or whatever that evolves into, will be the “official” method for automating Office applications. The code will be separate from the Office document and will be “managed” (in quotes because I’m not 100% sure what that means). All of your VBA code will still run. It will still live in your documents and you will still be able to add, modify, and delete VBA code just as you do now. The adding of code will be limited to legacy features (remember no updates to the OM), but that will cover about 99% of what’s in Excel and 99.9% of what you want to use (with one notable exception). The last pain in your ass will be that spreadsheets will be, by default, unable to run “unmanaged” code. Your users will have to go into the Virtual Security Kiosk to enable running VBA code. Did I mention that this was speculation.
So that doesn’t mean that VBA is dead-dead, just dying. I will still write VBA code for myself and others. I will still encourage anyone to learn VBA if their goal is to automate Office applications. There’s really nothing wrong with learning VBA. Learning any language will be useful. I learned BASIC then Pascal in my formative years. I remember exactly nothing about Pascal but it probably helped me in some way and it certainly didn’t hinder any future learning. However, if a 13-year-old kid says he wants to be a coder, there’s probably a better path than one that goes through VBA.
Don’t stop writing macros or reading Excel blogs because I said VBA is dead.
What evidence do I have for these predictions? None, it’s all speculation. Haven’t you been paying attention? Well, there are a few things, I guess. First, there’s no VBA in the Mac version of Office. I’m not sure if that happened in the last version or will happen in the next version, but it’s official. Maybe MS is simply getting out of the Apple business and it’s no real reflection on VBA. Or maybe VBA isn’t an asset with a future so the cost of porting it to Apple’s new OS isn’t worth the cost.
Microsoft is a tool of governments. Governments threaten to use open source products and Microsoft comes out with XML. Why on earth would anyone store a spreadsheet as a text file? The only reason is that because some influential customer says that they need an open format. The people who make those decisions aren’t the people who use VBA.
Microsoft is a tool of big business. IT managers hate Excel and Access. They want all of the programming needs of the company to flow through the IT department. They don’t want accountants writing VBA code that could delete a bunch of files. On the other hand, accountants don’t want to wait three months to get a bug fixed in their invoicing program. Is MS pandering to the IT manager or the accountant?
There’s this minor little change to the UI in Excel 2007 called the Ribbon. Maybe you’ve heard of it. There’s no Ribbon object in the Excel or Office object models. Oh sure, there’s plenty of great reasons why the Ribbon isn’t there. But it’s not. And next time it will be something else. Then something else. Then the OM is static.
I called MS a tool twice and a panderer once. Those are meant to be a little derogatory because I’m neither a government or a big business. But, honestly, who can blame them for trying to meet the needs of their largest customers? I don’t. It’s exactly what I would be doing if I were in their shoes. And I’m not overly concerned about the VSTO future of Office automation. I separate my code and data now, so it’s not that big of a change for me. If they put VBA syntax in the CLR (DLR?), it would be a non-issue for me.
Finally, I should address those that say “Microsoft isn’t stupid. They won’t alienate such a large customer base by relegating VBA to the attic.” Won’t they?