If you have gone to the trouble of learning how to write VBA in Excel you may be wondering whether VBA is still going to be supported going forward given that Microsoft announced in 2007 that it was no longer offering licenses to applications outside of the Microsoft suite of products.
VBA is no longer actively supported by Microsoft though it remains a feature of programs such as Excel, and this appears likely to be the case for quite some time because there is a very wide range of companies that rely upon VBA for automation.
However, there are signs that Microsoft is progressively positioning VBA to be removed from excel in the longer term but it seems likely that this will not occur for at least 10 years.
The signs of this are the fact that office suite now contains office scripts which is a programming language designed to work with the web-based version of Excel which is something that VBA does not work with. However, office scripts have some significant limitations associated with it which means that Microsoft will need to significantly upgrade the language in order to make it suitable to entirely replace VBA.
What Are The Limitations Of Office Scripts Compared To VBA
There are several limitations associated with office script the most significant being that it does not work with the desktop version of Excel which the vast majority of companies use.
The other significant limitation is that office scripts does not work with user forms and will not produce things like message boxes and input boxes. This is a significant disadvantage because it basically means that office scripts really only have the capabilities that you can get from recorded macros in VBA.
As a result of these limitations, it will be necessary for Microsoft to significantly upgrade this language’s capabilities before it could potentially fully replace VBA.
What Are The Advantages Of Office Script Compared To VBA
The first and most obvious advantage of office script over VBA is that it does work with web applications. The second advantage is that office scripts are more easily transferable to other files and uses because the scripts are stored within OneDrive and can be called up for different files without having to individually write the code within each file.
The other significant advantage of office script is that any recorded macros have comments automatically placed into the code that is produced. This tells the user precisely what each line of code is doing which makes it significantly easier for those that are inexperienced with the code to modify it. So learning office scripts is relatively easy compared to VBA. An example of what the code looks like with comments is provided below.
Additionally, the code editor within office scripts also provides a simplified display showing me actions that have been recorded during the creation of a macro which generally makes it a little bit more user-friendly than the current VBA code.
As you can see from the images above the code that is produced during a recorded macro is significantly more compact than when it is done with VBA primarily because when cells are selected they produce a single line of code rather than lines and lines of code for each individual cell.
Finally, the other significant advantage of office scripts is that it can be automated through power automate. This means that macros can be triggered without even having Excel open, which is a significant advantage when you are running the same macro over and over again in the background.
So What Do I Think Is Likely To Happen With VBA
This part of the article is purely based on my opinion rather than any published information or facts from Microsoft so please take it with a Grain of salt.
Based on the history of different versions of VBA and Excel which are listed below it appears likely that any changes to VBA including its removal from Excel is likely to be slow and flagged by Microsoft well in advance of when they are going to implement changes of such significance.
- Excel 2016: Microsoft Visual Basic for Applications 7.1
- Excel 2013: Microsoft Visual Basic for Applications 7.1
- Excel 2010: Microsoft Visual Basic for Applications 7.0 (introduced the 64-bit version)
- Excel 2007: Microsoft Visual Basic 6.5
- Excel 2003: Microsoft Visual Basic 6.5
Historically, new versions of Excel have come out every 3 to 4 years and changes to the programming environment as you can see above have been slow with there being up to 7 years between The new versions of VBA.
This suggests at an absolute minimum they were looking at least 7 years before there is significant movement by Microsoft to remove VBA from Excel. Additionally, I think anything Microsoft does is likely to be done relatively carefully because the removal of VBA will be significant for many of its business customers.
The reason for this is that forcing a change among business customers will necessitate redeveloping many systems used by companies. This provides a window of opportunity to make a decision about whether to stay with excel or to go to something like google sheets which also has a scripting language designed to automate tasks.
So given these factors, I think it seems likely that you are looking Beyond the 10-year range before there is a significant need to move away from VBA and possibly significantly longer depending upon the strategic direction of Microsoft in the future.
Is VBA Worth Learning? Does It Take Long?
Can VBA Be Used In Google Sheets?
Does VBA Work On Mac? Are There Any Problems?
How Format A Cell In VBA? A Simple Way To Find The Code?