top | item 26126459

(no title)

richx | 5 years ago

I love VBA, it’s so easy and powerful. My first job was being a developer/consultant at a big 4 firm, developing a disclosure management software with VB6. It even had a ORM to map objects from SQL queries. It was lightning fast, Office integration so superb. Later it was ported to .NET with a proper client/server architecture, still it never reached the speed and simplicity of the VB6 version.

discuss

order

foepys|5 years ago

People are downvoting you but are overlooking the fact that it's not always about making things in the newest tech but more often than not about making things work. Most software will only be seen by industry specific users that don't care that the program is React Native and runs on AWS. A simple VBA script is sometimes completely sufficient to input the data into a spreadsheet. Scott Hanselman called devs doing this "Dark Matter Developers" [1].

32bit VB6 programs are still able to run on modern Windows 10 machines, even on x64. The hours that would've been lost on porting everything to the newest macOS can be spent on new features or customer wishes. With the .NET Framework it's even possible to seamlessly use VB and .NET in the same program which combines old and modern technology. It's officially unsupported but it works and even gets bugfixes sometimes.

1: https://www.hanselman.com/blog/dark-matter-developers-the-un...

bgroat|5 years ago

I don't want to say "anti-pattern" because that's not what I mean...

But new tech should be the last resort.

If nothing stable, decades old, and well documented can solve the problem then reach for hot new-ness

smitty1e|5 years ago

I've never ever tried VBA.Net.

But my private NVBC (NecroVisualBasiCon) repo has some great stylings that I tap into at least once a year.

Nevertheless, when are they going to relase Office with Python bindings included?

dccoolgai|5 years ago

20 years later it seems I spend months fighting overwrought frameworks like Webpack and React to get the equivalent productivity I could get in one day with VBA.

sokoloff|5 years ago

My frustration with VBA is that it didn’t seem very well documented.

If I could record a macro that was “close” and examine it, the ecosystem was very productive. Once I wanted to go beyond that, it seemed like there was an undocumented chasm to cross.

Pasorrijer|5 years ago

This has gotten a lot better with the internet.

Almost everything in VBA can be found with a simple Google search, and Microsoft's technical documentation online has gotten very good.

airstrike|5 years ago

VBA is great for many things but it has its flaws.

The biggest problem with it is really that the tooling around it is decades old so it hurts your productivity. Maintaining VBA code bases is a painful experience, the IDE sucks and the language has enough quirks and shortcomings that it forces you to take long detours to accomplish what would be very simple tasks in more modern languages

The loving part of VBA is its interoperability across the Office suite, but there's no reason why that couldn't be done in, say, Python

Oh, I almost forgot. VBA classes are absolute misery.

ddingus|5 years ago

This is the part which saves crazy time:

The loving part of VBA is its interoperability across the Office suite, but there's no reason why that couldn't be done in, say, Python

I agree with you, but Python and pretty much every code environment is missing a few things that create a pretty high barrier to entry:

For a whole lot of cases, VBA is not even needed. People put data into cells, operate on it with formulas in other cells that drop output into still other cells which are then used to get output.

Input can be almost anything these days.

Formulas have a well defined, easy to understand syntax that work across a wide variety of operators. Simple copy / paste operations make sense, often with the intended data mapped right in. (given people are a little organized)

Output can be almost anything these days too.

And it's live. Make a change, see it happen.

That's real power! People don't have to know much to make it all work either.

I have been using Excel to transform business data for years, model business and a lot of other things, and as a rapid prototype system. I can write code too. Often I do, but the more specific and or variable the task is, like a one off need to solve yesterday, the more attractive just banging it out in Excel becomes.

Should one get super crazy, have one of those outputs from Excel be a working program. No joke. A script file is one of my favorite outputs. Mash the data up in Excel, and once the plan of attack is clear, execute the script and watch it run on the real system.

Check this thing out:

https://github.com/tilleul/apple2/tree/master/tools/6502_ass...

It's a perfectly usable, and I would suggest one of the easiest, assemblers I've ever seen! I ran it on my mobile. Crazy.

I just used it to knock out a little routine for a retro-game project I'm working on and was kind of stunned at how lean, accessible, functional this really is.

For Clarity: Replacing VBA with something else costs more than the value add at present, and it's because Excel is the gateway drug into VBA. By the time people reach for VBA, they already are familiar with a lot of it.

passivate|5 years ago

>the language has enough quirks and shortcomings that it forces you to take long detours to accomplish what would be very simple tasks in more modern languages

Any examples that you've come across?