Live data from Hacker News

Why do people still use VBA?

sancarn.github.io

391–400 of 421 posts

Re: Why do people still use VBA?

#391

VBA is a lovely language, that supports object-oriented programming (with composition... no inheritance). It has deep access to and control of Excel. It's mature and stable (Microsoft is no longer significantly changing it). "Real programmers" hate on it largely because of all the amateur spaghetti VBA code written by the business people (that the programmers are occasionally asked to debug).

I have invested copious amounts of time into building VBA libraries (https://github.com/sancarn/stdVBA) and as much as I love vba there are some highly limiting actual problems with VBA (https://sancarn.github.io/vba-articles/issues-with-vba.html) which really hurt the language. But yes a large portion of the hate VBA gets is from the state of VBA projects (https://sancarn.github.io/vba-articles/why-is-vba-most-dread...)

Re: Why do people still use VBA?

#392
Because of microsoft office ( particularly excel ). It's just as simple as that. I remember years ago people thought that google's free office/spreadsheet offering was going to be the end of microsoft office/excel. I remember having a good laugh back then. The business world, especially finance, runs on microsoft office. I just don't see it changing anytime soon. It's amazing how entrenched it is.

Re: Why do people still use VBA?

#393
post #277

This is all beyond the scope of VBA, but: Don't get so emotionally invested in tools because they're just tools at the end of the day. The business doesn't care what tools are used so long as they do their job. Also, knowing how to navigate a convoluted tooling systems ensures your job security, so why are you complaining again?

> so why are you complaining again?

Because a job that would take 15 minutes turns into a 3 hour task. It might surprise you but some people actually enjoy their job and ticking off tasks :)

Re: Why do people still use VBA?

#394

VBA is a lovely language, that supports object-oriented programming (with composition... no inheritance). It has deep access to and control of Excel. It's mature and stable (Microsoft is no longer significantly changing it). "Real programmers" hate on it largely because of all the amateur spaghetti VBA code written by the business people (that the programmers are occasionally asked to debug).

I mean I think it's fair to look askance at any environment that includes misfeatures like `On Error Resume Next`.

hey, I deliberately use that all the time lol

Re: Why do people still use VBA?

#395

Many VBA people are just SMEs who needed to spice their work with a bit of script so they learned one thing they had immediately available to them that could be used to solve their problem. Many of these people do not think about themselves as developers. They have primary responsibilities outside of IT structures which usually means that "more professional" tools are not available to them. They invested substantial…

> they would have to essentially start from scratch if they wanted to do anything else like Python

I do tend to disagree here. It really depends how invested they are with VBA. Many VBA skills are highly transferrable to Python and other high level programming languages.

I was fortunate to have experience with multiple languages from the start, but many of my colleagues have programmed in other languages other than VBA after learning VBA only to begin with. From Ruby to Python and beyond.

Re: Why do people still use VBA?

#396

I've been developing VBA macros since 20 years. It's largely the same language as it was when I first started. I've made lots of automations with VBA but nowadays, I've almost fully moved to UiPath RPA. I think RPA is very underrated and it should be used in place of VBA for complex automations like button clicks, data entry, scrapping, etc.

I do RPA from VBA personally using IAccessiblity. See stdAcc (https://github.com/sancarn/stdVBA/blob/master/src/stdAcc.cls) and an example (https://github.com/sancarn/stdVBA-examples/tree/main/Example...). You are basically doing the same as what you'd do in UiPath, by the looks of things. Just a slightly different flow.

Re: Why do people still use VBA?

#397

I've been surprised to see many pro devs using Excel/VBA as a secondary tool. One example: a couple years ago I was working with a big hedge fund and one of their data analysts sent me an Excel model he had built and I was tickled to see the .xlsm extension (i.e., VBA code on board). "Ahh ha", I thought, "Let's see what these macro-recording cowboys have been up to." There was a lot of VBA inside, all written by this…

I ran a pre-admission (surgery) clinic at a major university hospital through Excel.

VBA is powerful and quick at prototyping/iteration.

I would even venture to say that VB6 was the zenith of CRUD apps

Re: Why do people still use VBA?

#398

do we have another language can easily control Microsoft office? I mean, it is possible to perform analysis by another tool/programming language, but what if we need to control PowerPoint?

Actually, every language in theory. At least any language which can use COM APIs can interact with PowerPoint. Ruby, Python, NodeJS, C, C++, C#, Java, Rust, ... Pretty much you name it and it can control powerpoint unless it is sandboxed.

Re: Why do people still use VBA?

#400

Earlier quoted context omitted.

All true, but the fascinating thing about the article is that it's the Subject Matter Experts demanding to use something other than VBA to be more productive, and the IT people saying no VBA is the only thing allowed because...reasons.

Often those SMEs are data folks, and if they are allowed to develop in $TOOL_DU_JOUR, and that app becomes business critical, the IT folks will be stuck supporting it. And if that thing doesn't become well supported, or it isn't easy to find someone who can support it, that's a problem. I've run into this quite a bit at my workplace. Some business group writes an app in Excel using VBA + an add-in and it becomes the…

In our case (and in the article), we wanted to collaborate with IT, code along-side them in a technology of their choosing. However IT explicitely told us that they would NOT allow us to do any coding whatsoever.

I, as an SME, am fully happy coding in C#, Java, Rust, whatever! As long as the language is turin complete, is pro-code and versatile enough, I'm all ready to go.

Do note that IT actively chose to develop the solution in Microsoft PowerApps, despite my advising that the solution would be better suited as a web app.

Post reply on HN