Live data from Hacker News

Why do people still use VBA?

sancarn.github.io

91–100 of 421 posts

Re: Why do people still use VBA?

#91

Corps have a dev environment sitting right in Excel that doesn't need special (management, management's management, adding to a registrar of projects, budgeting or project manager assigned, etc) approval for non-stock software. The stack's Excel, plus Sharepoint if you're really looking for a networked data store that also has a web interface. From that end-user direction, solutions emerge. And they're in VBA.

Worth also pointing out that sometimes when you're in a corporate dystopian hell hole do not expect to be able to actually request or install software on your device. What is there is what you have and trying to get it changed is an exercise in taking on the bureaucracy. It's not worth it. Many people have tried and failed.

Back in the dark ages, we had a horrible reporting engine in Word VBA that pulled report definitions off a fileshare and cut and pasted bits of templates together and then printed them. Literally there was a computer in the office the IT team hadn't taken back because the guy had quit and we logged it in as one of us and ran that .doc all day to do numerous engineering reports. This was quicker and cheaper than filing a PO for the reporting option on the CAD/CAM software which would have taken at least 18 months, involved consultants and eaten at the project budget.

So when everyone bitches about Excel VBA being used for horrible things, the cause is probably further up the stack.

The other cause is what I call monkey hammer. If you give a monkey a hammer he's going to hit things. Everything looks like a VBA solution when you're a monkey and the only hammer you have is VBA. I am a slightly more evolved primate these days.

Re: Why do people still use VBA?

#92

Corps have a dev environment sitting right in Excel that doesn't need special (management, management's management, adding to a registrar of projects, budgeting or project manager assigned, etc) approval for non-stock software. The stack's Excel, plus Sharepoint if you're really looking for a networked data store that also has a web interface. From that end-user direction, solutions emerge. And they're in VBA.

I don't understand how's Excel page with macros inside different from random exe file from security perspective? Does Excel have some kind of excellent sandbox implementation, so it's safe to run random macros on the work machine?

The "difference" is only an advantage to attackers, in that executables are typically blocked as email attachments and Office macros are not.

Here's a ransomware incident report from someone opening an Excel document with macros enabled:

https://thedfirreport.com/2023/05/22/icedid-macro-ends-in-no...

Re: Why do people still use VBA?

#93

Earlier quoted context omitted.

I always read those “X automated their job, finishes it 15 minutes and then does whatever” and wonder how true are they? How could it be that nobody notices or cares?

I started my career like this, with a boring job where I inherited a gigantic excel with a few macros. Every day I had to download via ftp millions of logs from high speed trains from all over france (the logs themselves were retrieved manually via a serial cable on each train by maintenance guys every few days). I would then run a few macros that would do a bunch of geoloc calculation, spit out results in 2 tables,…

Nice story! Curious, was the manager a technical person e.g. a former engineer?

Re: Why do people still use VBA?

#95
post #9
post #8

Because Excel is the highest velocity application development tool. It's total shit after the first week but it's very very quick prior to that.

Excel is by far the most used no-code/low-code platform, IMO.

Excel is purely functional programming for the masses and I mean that as a good thing.

Re: Why do people still use VBA?

#96

VB(A) is like Python. It's not pretty, but it gets the job done. (* if you think it's pretty, it's because you are inexperienced and don't know the many better alternatives *) Any tool with a good ecosystem (tools/libraries/integrations) which allows you to get real work done is useful. Visual Basic as a desktop app development system (or MS Access which added DB benefits) was very useful in a large number of scenari…

> if you think it's pretty, it's because you are inexperienced

Python is pretty and I say using spaces beats using curly brackets, begin/end or if/else or other block marking strategies

Experience is also knowing that pretty or not has some subjective component to it

VBA evolved in "harsh" conditions, which kind of explains some of its weirdness though.

Re: Why do people still use VBA?

#98

Corps have a dev environment sitting right in Excel that doesn't need special (management, management's management, adding to a registrar of projects, budgeting or project manager assigned, etc) approval for non-stock software. The stack's Excel, plus Sharepoint if you're really looking for a networked data store that also has a web interface. From that end-user direction, solutions emerge. And they're in VBA.

I don't understand how's Excel page with macros inside different from random exe file from security perspective? Does Excel have some kind of excellent sandbox implementation, so it's safe to run random macros on the work machine?

No, it's never safe to run random macros. Macros arguably used to be the biggest initial attack vector for threat actors. Maybe still are. Microsoft built a ton of mitigation around it (macros are only allowed in docs with special extensions, macros must be activated by the user, only signed macros will be activated, mark of the web, etc.).

Re: Why do people still use VBA?

#99
post #85

Earlier quoted context omitted.

I always read those “X automated their job, finishes it 15 minutes and then does whatever” and wonder how true are they? How could it be that nobody notices or cares?

I'm sure it does happen; there are a surprising number of duct-taping jobs where a person is hired to fill in a systemic/organisational/processual gap with manual labour. Those are often very good targets for automation. There are also the other stories we don't hear: One of my first jobs involved a very repetitive software task that got boring quickly. I spent four weeks trying to automate it, but eventually had to…

The automation trap I keep seeming to hit is where I can only output garbage because the input is garbage. And people around me say "well it's obvious this user wrote their name incorrectly and you should have fixed it when you copied it", which would be fair if not for the fact the precludes a script just copying it for you.
Post reply on HN