In recent discussions, one recurring theme is that VBA (Visual Basic for Applications) is obsolete. There are claims that it has been superseded by newer technologies and no longer developed by Microsoft. While these arguments are frequent, they often miss a fundamental understanding of what VBA actually is and why it continues to be relevant. The conversation I watched recently between Excel MVP Patrick Samborsky and Daniel Zelinski on LinkedIn touched on similar points but left out crucial aspects of VBA’s architecture, history, and purpose.

Understanding VBA’s Foundation

To grasp why VBA is still important, we need to go back to the origins of programming languages. Before the 1960s, computing was dominated by mainframes from companies like IBM, Burroughs, and Wang. These computers were programmed by hardcore developers using languages like Fortran, COBOL, and ALGOL—languages that were cryptic, specialized, and accessible only to those with significant technical backgrounds.

This began to change in 1963 when two professors from Dartmouth College created a language called BASIC (Beginner’s All-Purpose Symbolic Instruction Code). The goal was to make programming accessible to non-technical users—ordinary people who weren’t part of the STEM (Science, Technology, Engineering, and Mathematics) fields. BASIC used simple, symbolic instructions, like “LET” and “IF”, that anyone could understand. It allowed people to write programs without needing to learn cryptic programming syntax.

BASIC: The Birth of Microsoft

BASIC played a pivotal role in the rise of personal computing, and it’s where a young Bill Gates began his programming career. Gates and Paul Allen founded Microsoft in 1975 with their first product, Microsoft BASIC, which was a commercial version of the language. It was an instant success, providing a standard for enthusiasts to write software for the growing number of personal computers, including the iconic Sinclair ZX80.

The Sinclair ZX80, created by British inventor Clive Sinclair, was a key milestone in the personal computing revolution. It was programmed in BASIC and allowed users to perform tasks by writing simple code. This era established the foundation for home computing, with BASIC becoming the go-to language for early personal computer users.

The Evolution of Programming: Object-Oriented Paradigms

By the 1980s, software development was evolving into a new paradigm: Object-Oriented Programming (OOP). The basic idea behind OOP was that instead of writing hundreds of thousands of lines of procedural code, developers could create reusable blocks of code called objects. These objects had properties (such as color, size, or value) and methods (actions like “move” or “clear”) that could be used in various applications.

This shift to OOP was a game changer for software like Excel. By the time Microsoft released Excel 5 in the early 1990s, it had adopted OOP principles. Excel became a collection of objects, like cells, sheets, rows, and columns, each with properties and methods. These objects could be manipulated programmatically, and this is where VBA came into play.

VBA: The Power Behind Excel’s Flexibility

VBA was introduced to give users programmatic control over Excel’s objects. For instance, a cell in Excel isn’t just a static entity; it’s an object with properties like font type, color, and value. With VBA, you can manipulate these properties, allowing you to customize Excel far beyond the options available in the ribbon or menus.

The beauty of VBA is that it leverages Excel’s object model, which is vast. Excel is packed with hundreds of built-in objects—both visible and invisible. For example, ActiveX Data Objects (ADO) enable Excel to connect to external databases, retrieve or update data, and work with external systems—all with just a few lines of code. ADO is an example of a non-visible object that ships with Excel but can be activated and used when needed.

VBA: Setting Properties, Not Programming

A common misconception is that VBA involves complex programming. In reality, what you’re doing with VBA is more like adjusting settings—setting properties and firing off methods within Excel’s objects. For example, to assign a value to a cell using VBA, you’re simply changing the “Value” property of the cell object. Similarly, to clear a cell, you’re triggering its “Clear” method. These actions don’t require deep programming knowledge; they’re just a matter of setting the right properties or invoking the right methods.

This makes VBA accessible to non-programmers, just as BASIC was designed to be. The underlying complexity of Excel’s objects is hidden from the user. You don’t need to understand how the cell is rendered or how its properties are stored. You just need to know which property to change or which method to invoke.

VBA vs. Office Scripts: Why VBA Is Irreplaceable

Some argue that VBA will be replaced by technologies like Office Scripts, which are based on JavaScript. However, this is misguided. VBA is tightly integrated with Excel’s object model, which was designed with it in mind. JavaScript, on the other hand, is a general-purpose language not originally intended for manipulating Excel objects. While JavaScript might be popular among programmers, it doesn’t offer the same direct access to Excel’s rich object model.

Switching from VBA to JavaScript would be akin to asking someone who flies a remote-control model plane to suddenly pilot a real jet. They’re two different things entirely. VBA was designed for Excel, and it remains the simplest and most efficient way to interact with Excel’s objects.

Conclusion: VBA Isn’t Dead—It’s a Cornerstone of Excel

When discussions arise about whether VBA is dead, they often overlook the core reason for VBA’s existence. VBA provides a direct, easy way to manipulate Excel’s objects, and nothing has come along that offers a simpler or more integrated solution. While new technologies will continue to emerge, VBA’s unique role in Excel isn’t going away anytime soon.

So, if you’re worried that VBA is becoming obsolete, rest assured—VBA is here to stay as long as Excel itself continues to evolve. It’s not just a programming language; it’s a tool designed to make Excel the incredibly versatile platform that it is today.

This is a podcast by Hiran de Silva. Narrated by Charlie.

Hiran de Silva

View all posts

Add comment

Your email address will not be published. Required fields are marked *