EEVblog Electronics Community Forum
Products => Computers => Programming => Topic started by: Alex Eisenhut on January 02, 2023, 09:23:17 pm
-
It is just usable within LinreOffice or can you make stand-alone programs with it? It's not terribly clear to me, I just recently found out it even exists as I was playing around the menus.
It seems to be only useful for scripting stuff within LibreOffice.
-
Alternative to VBA (https://en.wikipedia.org/wiki/Visual_Basic_for_Applications). If you have never seen it: open up any copy of (non-web) Microsoft Office and press Alt+F11
-
It is integrated into Libre Office. There is no standalone version. It is a logical equivalent of Visual Basic for Applications (VBA) from Microsoft.
There may be some way to run it in headless mode., but it would still require the full office package, which is a huge overkill for generic programming.
-
For some background:
- VBA is amazingly powerful, because you can talk to DLLs and do all sorts of arbitrary things in the OS
- Lots of companies have internal tools that use lots of VBA to automate tasks.
- MS Access databases tend to use a lot for their GUIs
- VBA can do any action you can in your office suite (I vaguely recall some annoying exceptions?)
- VBA has lots ugly, rough edges in its syntax, IDE and error handling that have never been improved. Things that will drive you mad.
- VBA interactions with office can be ridiculously slow (I think you can tell MSO to stop re-rendering the GUI after each step however? It's been a while)
- VBA in files that you open is disabled by default as it can deliver malware
- VBA is lock-in. It would be almost impossible to make a 1:1 replacement (without copying all the DLLs)
I've never used LO Basic so I can't comment on how good it is.
Puzzle for the grizzled old players: name the differences between VBA and VBS >:D
-
- VBA is lock-in. It would be almost impossible to make a 1:1 replacement (without copying all the DLLs)
So much that even MS can't (or won't) make a even a partial version for Office 365 online. All those excel macros spreadsheets are useless for online users. This is super annoying when chip vendors supply design tools in the form of spreadsheets with VBA macros.
-
So much of desktop MSO is missing in Office Online. Not to mention the nasty latency and general lag. Documents look different in both of them and certain things break. They're completely different pieces of software that share the same name, although I must admit I gain a nasty sense of amusement imagining them trying to compile parts of MSO C++ source into some form of javascript/webASM.
chip vendors supply design tools in the form of spreadsheets with VBA macros.
Eep. I'd read through everything before enabling it.
On the flipside: this might be an easy way to convince vendors that I'm a "big player". All I have to do is send them a document with cryptic VBA code that crashes on their computers and they'll know I must be a fortune 500 company.
-
VBA is one of those ideas which has lots of merit, and whose implementation has made it almost worthless.
On the plus side it has made it possible for me to do lots of useful extensions to Excel, adding functions for black body radiation and several useful statistical functions.
It also gave me a soft introduction to OOP programming which has always been opaque to me having started with decades of procedural languages.
On the down side, as others have mentioned it makes it possible to do all sorts of mischief, and most places I know lock down execution of VBA to protect against this.
On top of that the implementation changes in subtle ways over time. Stuff you wrote for Office 97 isn't guaranteed to work in later regions. The more you generate the more maintenance work you are committed to doing.
And while there is no standalone version of VBA that I am aware of, it has lots in common with MS Visual Basic. You can download at least a partial version of Visual Basic for free the last I checked. The good news - it provides access to all infrastructure for Windows programs (text boxes, buttons, drop down menus and the lot). The bad news, just like VBA it changes every couple of years.
-
And while there is no standalone version of VBA that I am aware of
VBS >:D
-
How much I support libre software, scripting support in StarOffice and descendants seems like a failure. VBA was the third programming language I learned, and even MS Office 97 had very good programming environment with great documentation. In early 2000s MSDN, which included support for the VB family, was something I would consider among the finest help systems I know for software of that size.(1) Compared to VBA, the LibO environment feels like using Notepad.exe. Documentation, where available, suffers from the syndrome of being written by the author, who already knows the API. Almost useless for anybody else. :(
While with time I moved to position that it’s an anti-feature in document editors,(2) at least if the code can be attached to documents, there is one exception: database programs. Both Microsoft Access and LibO Base are tools for building frontends to databases. In particular Base is not by itself storing any information. Not having a sane programming language for that kind of software renders it useless.
(1) I could probably find some better examples, but for much smaller projects.
(2) Text processors, spreadsheets, presentation creators, drawing programs.
-
Compared to VBA, the LibO environment feels like using Notepad.exe. Documentation, where available, suffers from the syndrome of being written by the author, who already knows the API. Almost useless for anybody else. :(
Yeah sadly that's what I concluded. At first I was curious but after a bit of poking around I just closed it. As I age my attention span is decreasing...