Live data from Hacker News

Why do people still use VBA?

sancarn.github.io

381–390 of 421 posts

Re: Why do people still use VBA?

#381
post #10
post #3

Earlier quoted context omitted.

That's exactly why I use it. Only dev environment available to me.

Windows ships with VBScript, JScript, CMD, C#, and PowerShell right out of the box. I recall interviewing a college guy around 2018, and he tried to educate me about how Windows doesn't have a good command line / scripting / automation solution beyond command.com. I think I still said "hire" because he had other talents, but damn.

VBScript is deprecated: https://nolongerset.com/vbscript-deprecation/

JScript is deprecated, and is likely to be removed at some point too...

CMD is often blocked on many people's machines due to group policy.

PowerShell is really the only other option other than VBA, as discussed in the article. Only reason I haven't used PowerShell til now is the version was hidiously outdated and didn't even support classes... Of course with PowerShell you can evaluate C# code.

Re: Why do people still use VBA?

#382

Earlier quoted context omitted.

Thanks. Agreed. By "stateless", I'm assuming you mean functional programming paradigms of immutable, idpotent, and no side effects. FWIW, for build pipelines, my quarter-baked notion is to use ZFS snapshots (or equiv). I'll check out Pluto for Julia. As you know, state is a challenge for "serverless" too. I've been reacquainting w/ RDBMS tools. There are a few new strategies (implementions) for change tracking. Back…

In the notebook context the main gripe is that notebooks have the "invisible" memory state that means that one can't deduce from the notebook code what it actually does. Or more concretely the order of execution of the cells affects what the notebook does. This leads to sort of higher level side-effects. With usual side effects you get spaghetti, with notebooks you get moving spaghetti in five dimensional space. Immu…

Sorry: of course side effects and mutability (not pure functions and immutability) should be used with goto-level caution.

Also the "higher-level side effects" apply more or less identically to REPL development.

Re: Why do people still use VBA?

#383

Let's face it: IT is the bureaucracy department of modern times which can keep itself 95% busy with self inflicted problems and has 5% service orientation. Processes are opaque for outsiders and typically not helpful. I really had to lough when I read the following description of the IBM BPM but this sums up a good part of the issue: "...while IBM BPM does come with a REST API, this REST API is borderline useless to…

I can find bad examples of how things work in basically every department I chose if I look long enough. Are there IT-Managed things that border on insanity? Oh yes. Are these a good excuse to build a shadow IT? No, they are not. Don't get me wrong: I'm not bothered at all when a couple analysts get together and hack away at their own little tools in VBA. Kudos to them for getting into the spirit of things, and maybe…

To be fair, as an SME, I do have documentation and an architectural overview. In my experience when I have provided these, they have been ignored anyway. I do not have access to git, because why would IT give me something useful? I think many users would use git purely as a VCS if they had access, but nope...

It shouldn't be a spreadsheet. The IT departments should democratise the tools which devs use, so even end-users can use modern tools for the job at hand. Then popping a user-made tool into your processing pipeline would be fair enough, and code can be collaboratively maintained. In the end, just as IT wouldn't want SMEs making changes without their knowledge, SMEs wouldn't want IT changing their core system without their knowledge either.

In my opinion, the more people who know and understand the core systems, the better.

Edit: for what it's worth, I do use github (https://github.com/sancarn/stdVBA), but you won't see nearly any versions of any corporate codebases, why? Git doesn't work great with VBA spreadsheets at all. I'm not going through a 10 step process to upload the updated file to the github repo every time I update a macro in a spreadsheet. This is why on-board git is important.

Re: Why do people still use VBA?

#384

Let's face it: IT is the bureaucracy department of modern times which can keep itself 95% busy with self inflicted problems and has 5% service orientation. Processes are opaque for outsiders and typically not helpful. I really had to lough when I read the following description of the IBM BPM but this sums up a good part of the issue: "...while IBM BPM does come with a REST API, this REST API is borderline useless to…

One of my first full time software engineering jobs was working on the trading floor of a bank, sitting next to the currency traders. I was hired by the head of Market Risk Management, whose job was to make sure the bank didn't lose too much money on any given day. He hired me because he did not trust the officially approved IT department to write the code to implement his algorithms. One example: they got something…

> We tried to work with them by giving them tools that plugged into Excel

This is probably one of the best ideas out there. If companies built a bunch of Excel Addins to leverage business systems, that would be revolutionary for many businesses.

Re: Why do people still use VBA?

#385

Earlier quoted context omitted.

There's a sentence in the article which says that this is an explicit policy decision of the company. > It is supposedly “Against the technology strategic vision of the company” to allow “end-users” access to high level programming languages.

And rightly so. Imagine for a moment that someone in accounting built a system in lisp to automate part of his job. As time goes on, he takes on more responsibility, which he writes more lisp for. One day, he gets hit by a bus. The lisp program he wrote is now an integral part of the running of the accounting department simply by accumulation and momentum, with tons of business logic baked in. Where do you look to fi…

This is already happening with IT maintained systems though... As specified in the article. So it really isn't an argument imo.

IMO, companies should have a language of choice which is actively encouraged to be used by everyone for all automation needs. Different departments build libraries to automate aspects of their jobs and other departments can use them if needed. I.E. it becomes yet another tool, just like Excel.

Re: Why do people still use VBA?

#386

Let's face it: IT is the bureaucracy department of modern times which can keep itself 95% busy with self inflicted problems and has 5% service orientation. Processes are opaque for outsiders and typically not helpful. I really had to lough when I read the following description of the IBM BPM but this sums up a good part of the issue: "...while IBM BPM does come with a REST API, this REST API is borderline useless to…

Someone needs to build a wasm interpreter in VBA. Then we can write programs in Go/Rust/etc and run them in office or wherever. VBA is to corporate environments what JavaScript is to the web.

Honestly, this is something I've been wanting to do for a while... Last I looked though, I couldn't find many good resources on how WASI (or the byte code) worked... And VBA being single threaded might make things difficult too...

I have already built my own code interpreter in VBA to make Lambda syntax possible: https://github.com/sancarn/stdVBA/blob/master/src/stdLambda.... so I know it's definitely possible, just haven't figured out WASM yet...

Re: Why do people still use VBA?

#387
post #36
post #5

Because it’s amazing! /s Years ago, I heard that JP Morgan had +20k access databases on their network. The data analysts that make up companies far and wide one day discovered that they hate what they’re doing every day. They investigate the “record macro” button. Some might even find it nifty. They use it again and again. Some may even try to get smart and investigate and get curious of the code that it spat out. So…

You get it, "record macro" is the key to this. MS could switch them to C# or JS or python or whatever, if they just added a button which did that.

Microsoft recently released OfficeScripts, which are JS with a record macro button. Problem is, it's currently too limiting. Will be good in a few decades though if support isn't dropped.

Re: Why do people still use VBA?

#388
post #36

Earlier quoted context omitted.

You get it, "record macro" is the key to this. MS could switch them to C# or JS or python or whatever, if they just added a button which did that.

This is the interesting thing. I haven't played with it myself but seems MS is trying that with their new Beta python script function, but their implementation is just crazy, completely handicapped. Can't see it being a true replacement for VBA in excel.

Agree, Python implementation in Excel is trash. Not at all a competitor for VBA. Not yet anyway.

Re: Why do people still use VBA?

#389

Because there was no good alternative until recently. The future is with the new "add-ins" model: https://learn.microsoft.com/en-us/office/dev/add-ins/overvie... Say what you will about typescript, but at least it's better than VBA. My main issue is that unlike VBA, I can't program it from right there in Excel. Sometimes I don't want to start up a full-fledged add-in project that's meant to be reused. I just want to…

Good if all you do is display a fancy UI for some data entry or visualisation, but OfficeJS can't do half the things VBA can do unfortunately. If only the addin system had FFI. I'd switch forever.

Edit: Another big issue with OfficeJS is you need to be able to host a web server. That's not usually something most end users have access to...

Re: Why do people still use VBA?

#390

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…

A business I run depends heavily on Google Sheets that I inject values into and read computed values out of. That lets us define rather complex business logic in spreadsheet form, and business and finance people can easily tweak it. Everybody is very happy with this solution.
Post reply on HN