Live data from Hacker News

Will VBA Die? (2019)

thespreadsheetguru.com

51–60 of 170 posts

Re: Will VBA Die? (2019)

#52
post #39

Earlier quoted context omitted.

Microsoft is slowly transitioning Excel macros to Javascript / Typescript. It will happen eventually.

The Excel object model is really a COM/IDispatch object model... it's been accessible from non-VBA applications essentially since the beginning. Not Excel, but one of my first consulting projects was at a company that developed some custom libraries in Java and for a company that used ASP for the front end. The architecture we used ran the Java code in the Microsoft JVM, which then made Java accessible via IDispatch…

At the moment the implementation is to basically inject code, but I imagine eventually Microsoft would like to move away from that.

Issues like DCOM and legacy systems would need some interface from Microsoft of course to handle IDispatch, GC etc, but thats what Microsoft do.. And to behonest, as much as I like to rip on them, they do it well.

Edit: I think the Java example is a little bit different, but i don't know anything about Proto-CLR!

Re: Will VBA Die? (2019)

#53
post #27

I'm working on an excell addin right now. It doesn't use VBA (it uses microsoft interop libs for .NET) And I have zero interest in using VBA, but I will admit, it would have been much easier to do this project in VBA instead of C#. Debugging would have been easier. I could debug inside the VBA code-behind instead of Attaching to the excel process in Visual Studio. Deployment would have been easier. I could make an .x…

> I would imagine most people that only know VBA would have no interest in using C# to write office interop code, and I don't blame them.

I'd be happy to use C# but it's so god damn hard to learn those libraries.

The biggest disadvantage in using VBA is speed – not to mention the idiosyncrasies of the language itself, which can make complex code rather painful.

Writing a .xlam addin is easy, except there's no tooling for creating "builds".

On a separate but related note, since writing XML for the ribbon by hand is so annoying (and you also have to write callback wrappers for each Sub you want to expose) I have actually written a python tool that parses annotations from comments in .bas files in a given folder and spits out a .xlam file. Haven't gotten around to publishing it but if folks are interested I can give it a little oomph and finish in the next few weeks, so lmk

Re: Will VBA Die? (2019)

#54
post #40

Earlier quoted context omitted.

Agreed. JavaScript has no real upside here besides being fashionable. whereas built-in C# with access to the .Net framework would be really powerful.

Comparing javascript to C# is really not appropriate here, for so many reasons. I do think you know the main differences between interperated, transpiled and compiled for starters, but the "right tool for the job" is far more important. Being fashionable is also not exactly fair, it was very flakey before jQuery created some entry level standard, because of its popularity it grew to what it is today, if thats 'fashio…

I am old. I have no idea what interperated is :)

Re: Will VBA Die? (2019)

#55
post #13

Microsoft should rather provide a better path toward office automation rather than just frustrate users. As I have seen it, javascript isn’t even remotely close to the sort of integration that made the success of VBA. Like how can I save a javascript macro as a user? Javascript user defined function? VSTA was a good attempt in its time, a mini visual studio integrated in office with VB.net and C# instead of VB6. That…

VSTO to the best of my knowledge is still a thing. And you could indeed do some pretty cool stuff with it!

But it's not as easy to use as VBA, nor was it incredibly easy to work with from a development standpoint when I last tried to use it (Maybe I was doing it wrong, but I had to do a full VS install with the add-in module.)

Re: Will VBA Die? (2019)

#56
VBA won't "die" anytime soon for the same reason Office or VB/VB.NET are still around. Legacy code. Almost every office in the US and probably around the world has VBA code in one of their office products ( excel, access, etc ).

Google spreadsheets was going to kill Excel, C# was going to kill VB, Sql Server was going to kill Access, etc. Look at how that turned out?

Maybe in an ideal world, but in the real world, there is a ridiculous amount of time, money and resources invested in VBA code. These sunk costs are very meaningful to corporations and governments and as long as corporations and governments give microsoft huge stacks of money, microsoft is going to keep VBA around.

Re: Will VBA Die? (2019)

#57
post #13

Microsoft should rather provide a better path toward office automation rather than just frustrate users. As I have seen it, javascript isn’t even remotely close to the sort of integration that made the success of VBA. Like how can I save a javascript macro as a user? Javascript user defined function? VSTA was a good attempt in its time, a mini visual studio integrated in office with VB.net and C# instead of VB6. That…

Agreed. JavaScript has no real upside here besides being fashionable. whereas built-in C# with access to the .Net framework would be really powerful.

Blockpad (http://www.blockpad.net), while not directly exposing C# is written in it so there is certainly potential in the future for such interop.

Re: Will VBA Die? (2019)

#58
My first apps ever were extremely customized VBA Access databases. I already knew QBasic so doing VBA was easy. It affords a ton of power. I was able to create an entire interface and workflow easily and have everything contained within one Access file. The only downside was when multiple users wanted to use it (I think one had to save/close to let another in). For small things (a workflow tracking a university's scheduling changes) it can be great. Filemaker is a similar tool and both tools allow rapid development and prototyping. It might not be that useful to seasoned programmers, but to people who just want to get something done quickly, and especially for people who don't program much, it's an amazing tool.

Re: Will VBA Die? (2019)

#59
post #40

Earlier quoted context omitted.

Comparing javascript to C# is really not appropriate here, for so many reasons. I do think you know the main differences between interperated, transpiled and compiled for starters, but the "right tool for the job" is far more important. Being fashionable is also not exactly fair, it was very flakey before jQuery created some entry level standard, because of its popularity it grew to what it is today, if thats 'fashio…

I am old. I have no idea what interperated is :)

:) Not sure if you're joking or not, so I'll be more rude and ask if you've ever written a compiler for the fun of it.. That will gauge your real age ;)

Re: Will VBA Die? (2019)

#60
Between the spread of excel across businesses and MS focus on compatibility it seems rather unlikely. It is kinda ridiculous how much depends on VBA macros.

Weirder things have happened, but whatever would replace it, would create an industry overnight.

Post reply on HN