29 ms·
Why do people still use VBA?
- throwaway154 3y agoCorps 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.
- Dan_W 3y agoThat's exactly why I use it. Only dev environment available to me.
- 13of40 3y agoWindows 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.
- qotgalaxy 3y ago[dead]
- jodrellblank 3y agoPowerShell including ISE, with tabs, multi-line cursor, syntax highlighting, autocomplete, step-through debugger, snippets, scriptable/extensible.
- RajT88 3y agoPeople think I am nuts for preferring the ISE over VSCode, but the ISE never crashes while running scripts!
- hobs 3y agoThen you haven't used it enough :) The bare shell on the other hand is usually solid.
- RajT88 3y agoThat's for sure not true. For my bigger projects (over 200 lines), I tend to use VSCode. Just having a look at the larger projects I've got up on github, I'm over 2000 lines across 3 projects - all developed in Code. ISE does occasionally hang / crash, but it's quite rare compared to how VSCode behaves across every machine I've used it with. It really seems to be just a Powershell problem, haven't had the same issue in any other language. When I'm really making great progress on something, having to fart around with killing and restarting the shell constantly is really disruptive. Yes, Code has better and more features, but for me the extra productivity does not overcome the crashy shell.
- hobs 3y agoI think you might be misunderstanding what I didn't say - I use the console for debugging (Set-PsDebug!) and even then it crashes (sometimes.) I don't like vscode for powershell development and I find the pycharm experience for powershell (lol) much better.
- pjmlp 3y agoYou're not, I would also rather have the Powershell team improve ISE than their decision to migrate into VSCode, but alas.
- TheJoeMan 3y agoAnd yet if you send your PS script to say an HR person… it won’t run on their computer without messing with security settings.
- 13of40 3y agoNobody on the team wanted that, not even Snover, but we were making that thing in about 2005, when everyone was getting burned by email based zero days. Even though we had the Set-ExecutionPolicy thing there were boogeyman news articles immediately after the v1 release asking whether the new scripting language was...too powerful.
- resoluteteeth 3y agoPowerShell with ISE is a lot better than the VBA editor in many ways but you're still in the same situation of using a long deprecated ide with an ancient version of a programming language (ISE is deprecated and if you're using the built in version of PowerShell you're stuck on the last legacy framework version from 7 years ago forever and missing a ton of improvements and fixes from newer versions of powershell)
- jodrellblank 3y agoToday, yes, but ISE has shipped with Windows since what, XP? And VBA never has - it's a part of Office.
- Pxtl 3y agoSo disappointed that MS hasn't rolled out PowerShell 7 but I guess it's easier to develop a programming language when you don't have to deal with users.
- orthoxerox 3y agoWindows doesn't ship with C# out of the box. It ships with the runtime for .NET Framework 4.8, but not with the SDK.
- anthk 3y agoI think it does since the Windows XP days, at least a CLI based compiler/interpreter.
- orthoxerox 3y agoWould you look at that, it does! C:\Windows\Microsoft.NET\Framework64\ has both MSBuild.exe and csc.exe, but only for .NET Framework up to 4.0. I was under the impression that 4.8 was installed on Win 10 machines via Windows Update.
- TeMPOraL 3y agoAs I understand it, PowerShell allows you, out of the box, to write some C# code in a string, and then run it. And by C# code I mean regular classes with all the bells and whistles.
- justsomehnguy 3y ago*wink* $code = @' using System; using System.Drawing; using System.Runtime.InteropServices; using Microsoft.Win32; namespace Background { public class Setter { [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern int SystemParametersInfo(int uAction, int uParm, string lpvParam, int fuWinIni); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError =true)] private static extern int SetSysColors(int cElements, int[] lpaElements, int[] lpRgbValues); public const int UpdateIniFile = 0x01; public const int SendWinIniChange = 0x02; public const int SetDesktopBackground = 0x0014; public const int COLOR_DESKTOP = 1; public int[] first = {COLOR_DESKTOP}; public static void RemoveWallPaper() { SystemParametersInfo( SetDesktopBackground, 0, "", SendWinIniChange | UpdateIniFile ); RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true); key.SetValue(@"WallPaper", 0); key.Close(); } public static void SetBackground(byte r, byte g, byte b) { RemoveWallPaper(); System.Drawing.Color color= System.Drawing.Color.FromArgb(r,g,b); int[] elements = {COLOR_DESKTOP}; int[] colors = { System.Drawing.ColorTranslator.ToWin32(color) }; SetSysColors(elements.Length, elements, colors); RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Colors", true); key.SetValue(@"Background", string.Format("{0} {1} {2}", color.R, color.G, color.B)); key.Close(); } } } '@ $null = Add-Type -TypeDefinition $code -ReferencedAssemblies System.Drawing.dll -PassThru Function Set-OSDesktopColor { param ( $r,$g,$b ) $null = [Background.Setter]::SetBackground($r,$g,$b) }
- sancarn 3y agoVBScript is deprecated: https://nolongerset.com/vbscript-deprecation/ 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.
- vbezhenar 3y agoI 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?
- dartos 3y agoCan you call os level functions from an excel macro? Can you access raw memory from it? If the answer to either of those is no, then that’s a big difference.
- meibo 3y agoYou can call any native or COM function from VBA, the only real limitation is that it's strictly single-threaded(-ish).
- nradov 3y agoYou can call Windows API functions from VBA.
- hnlmorg 3y agoYes you can. VBA can make the same Win32 API calls as VB6. Something I exploited back in the tail end of the 90s.
- anthk 3y agoCOM/OLE. Old as hell. Macro viruses in Office/Outlook has been a shitfest since late 90's.
- technion 3y agoThe "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-nokoyawa-ransomware/ https://thedfirreport.com/2023/05/22/icedid-macro-ends-in-no...
- mr_mitm 3y ago
- donatj 3y agoThis. My friend automated his whole job in Excel. He supposedly can do a days work in fifteen minutes and then just hang out. Their computers are super locked down, can’t install anything, can’t go to any non-whitelisted sites, but they have Excel.
- meibo 3y agoThat was pretty much my first job, I strongly believe this still happens every day around the planet :) I wouldn't want to go back to that 30kloc of VBA though!
- asdfman123 3y agoThis sounds like a very specific, personalized version of hell
- wiseowise 3y agoI 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?
- donatj 3y agoMy understanding is he basically gets paid to put data into easily automated categories, and the company is soulless and has no ambition for automating anything.
- prerok 3y agoI have a few colleagues that told me they have a job like that. Not done in 15 minutes but 2 hours, then they goof off for the next 6 hours. There are two reasons: 1. They have a specific job with a specific set of duties (think sysadmins, or administrative duties) in a large company or in a state beurocracy. 2. They would rather go home or do something more but they are not permitted: they have metered time in the office and other people would and do shut them down on any initiatives. To me, a workplace like that is like a kafkaesque nightmare but they seem to be fine with it, or rather, have accepted it. It lets them focus on other things in life outside of work.
- pyeri 3y agoPlus Visual Basic is a very powerful language on its own. Given an environment such as Excel Macros, its power can be unleashed and utilized to a great extent and that's what power users in many enterprises do. This is quite reminiscent of the good old "emacs operating system" paradigm just applied to a different context!
- toolslive 3y agoI've seen the following at least twice: some department manager (marketeers typically have a nack for this) needs something, can't or won't bother the development team and starts off with "how difficult can it be" and before you know it they've written a few hundred lines of VBA, which serves their needs. But then, the next phase starts: that scripts gets copied over (because Jim wanted to run it too) and modified (Jane has a different VBA version) and expanded (now it does "THIS!" too). Now it's a 1500 line kludge and they want to unload it, ie pass it over to development for maintenance.
- mathgladiator 3y agoAnd thats great because demand has be satisfied!
- lodovic 3y agoBut isn't that how it's supposed to work for these LOB type applications? Users prototype a solution and the developers then change it into a proper real world application. Alternative approaches are usually worse.
- liotier 3y agoLook at it another way: that script kludge is a prototype, a dangerous one of course, that embodies the functional requirement better than what the user could express. Understand its deep meaning (what the user meant to do and and not what they settled on considering their technical limitations) and you are ready to rewrite it into a proper implementation. We frequently stumbled upon this situations and we like them, because a well used kludge that reaches its breaking point has buy-in from all stakeholders for a well-budgeted industrialization !
- TeMPOraL 3y agoYes. And the entire thing is done in half the time it would take for the development team's managers to get through whatever bullshit agile scrum epoch meetings to ultimately deny the request because it's not worth their time - or worse, approve the request, and get you waiting a year for The Project Done Right.
- 3y ago
- baz00 3y agoWorth 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.
- liotier 3y agoI suspect that dystopian environments of locked-down mandatory corporate Windows laptops with no software installation privileges, firewalled networking and even the USB ports disabled are also part of the reason for every function being crammed into the browser to the point that the browser has become an operating system host... Creativity (and catastrophes) happens where there is freedom: local scripting and browser scripting !
- anthk 3y ago>no software install... https://portableapps.com https://portableapps.com I think there's even a Lazarus IDE available for every company user who wants to create reliable RAD based software bound to corporateware.
- liotier 3y agoDepends on the level of corporate restrictions. Workstations with the "developer" policy applied may do that (if they managed to smuggle the executable through the HTTP proxy, and as long as the program doesn't open an inbound port - upon which event the OS kills it) but others can only run whitelisted executables. Every day I miss the Debian computer I have at home.
- Twirrim 3y agoIt's there, it works. VBA is a very accessible and straightforward language to code in and iterate with. No faffing about with installing external dependencies and library hell, no compilation phase. It's really no surprise that VBA remains invaluable to businesses. I've worked with product managers that use VBA to perform absolutely jaw dropping levels of complicated business analysis, even in environments where they have access to other tools and languages, mature build processes etc, because it's the right tool for the job they have at hand.
- CodeWriter23 3y ago> that doesn't need special (management, management's management, adding to a registrar of projects, budgeting or project manager assigned, etc) Not entirely correct https://www.encomputers.com/2018/05/disable-macros-in-microsoft-office-using-group-policy/ https://www.encomputers.com/2018/05/disable-macros-in-micros...
- kjkjadksj 3y agoA lot of systems have python or perl already installed. I feel like perl in particular is probably way more portable and performant than whatever hacks you have to come up with in excel.
- username135 3y agoSharePoint lists and tables work very well with Access and Excel. Linking them all together is trivial but appears to others as if youve created a magic kingdom of data. Ive gotten far in my career using these oft laughed at tools.
- sancarn 3y agoI do agree, but they do have their limitations. Can't update sharepoint lists from Excel if you have more than 5000 records, can't update sharepoint lists generally unless you use VBA hacks (or use REST API and somehow get VBA to authenticate). I'm not certain whether you can update in bulk using access honestly, I'd be interested in knowing though... Even using REST API has it's own limitations. Generally I update them with client-ran JavaScript. I love sharepoint lists for their ease of use to users, but the limitations are pretty rubbish if ever you want to do anything programatically, unless you can figure out how to authenticate (and/or use a library which handles that for you).
- dieselgate 3y agoThink this is the same guy that makes videos about vim? Didn't know he had other types of content, he's good at conveying information. Edit: regarding the video embedded in article
- _boffin_ 3y agoBecause 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. Some might even go further and attempt to learn enough to change some things around. A handful might just learn data structures and algorithms to build out a auth / permission system that mimics Django. Might rebuild the UserForm UI from scratch. Implement markdown, sax parsing, custom scroll bar, logging, games. The answer is because a data analyst probably got bored of what they’re doing every day.
- owlninja 3y agoOr possibly they went to the IT department who threw down so much red tape from their ivory tower they were forced into the "shadow IT" sector. I've seen in large enterprises where some analysts have the skills to take the Frankenstein they built to the proper level, but are met with "well we need to start a project and make tickets, timelines, requirements, etc..". They certainly have good reasons - supporting something that anyone has to step into and learn is a valid concern. But as long as the business has access to tools that solve their problems, the "bored" ones will find a way. Too much friction.
- Valgrim 3y agoI agree, and I'll add this: these people are not exactly bored, they're just the type of people that see a problem, a solution, and got the time to connect them together. Now I think the best attitude toward that particular type of people is to encourage good practices instead of mocking or shutting it down
- shapefrog 3y agoIT came back asking for a budget of $750,000 to put the macro that one team uses into production.
- internet101010 3y ago
- jbandela1 3y agoWhy do Linux/Unix/Mac developers write shell scripts, when there are so many better languages out there? A large part is it integrates well with the shell and it is ubiquitous. VBA is basically the scripting language of Office. It integrates well with Microsoft Office, and in a business environment, pretty much everyone has access to it. Are there better languages? Sure. However, it is hard to beat the integration and ubiquity. And, VBA is a much, much better language than (ba)sh script!
- kibwen 3y agoThe difference here is that Linux devs would get rightly chided for building entire applications in shell scripts. The existence a "glue language" isn't a bad thing, rather, it's a good thing. But when you wake up to find that your whole project is made of 100% glue, you might consider that a bit of a mess.
- djbusby 3y agoEntire apps in shell can be very good, eg: gnu pass Exception, not the rule.
- vluft 3y agopass is not a gnu project.
- jgtrosh 3y agopassword-store does have some strong merits stemming from its Bash implementation, but from having followed its newsletter for a few years (and made a few changes in a fork) it also brought its fair share of bugs and weirdness.
- emodendroket 3y agoSure, they're great, so long as I don't have to modify them.
- Valgrim 3y agoAre entire VBA projects really that ubiquitous? As far as I can see, there are really two category of those: first are the huge proprietary plugins from large B2B companies that serve as a way to deeply integrate their products into Excel Spreadsheets, and the second are more like extremely customized tools built by the enthusiastic tinkerer of a non-technical team to make a complex and repetitive task easier. If there's a third category, please enlighten me
- Johnny555 3y agoApparently it's so ubiquitous that you don't even need to say what it is, every just knows. I looked it up -- VBA=Visual Basic for Applications. https://en.wikipedia.org/wiki/Visual_Basic_for_Applications https://en.wikipedia.org/wiki/Visual_Basic_for_Applications
- Traubenfuchs 3y agoI'd argue that developers beyond a certain age are as guaranteed to have come into contact with VBA as with HTML/JS.
- meepmorp 3y agoYep, I did a few VBA+Access apps in the mid-to-late 90s. VBA in Access 7/97 was kind of buggy, too, so there were some truly awful workarounds involved. And speaking of HTML, there was also VBScript, which for me is inextricably linked to classic ASP.
- mhh__ 3y agoBecause 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.
- enasterosophes 3y agoWhen I worked for an alphabet agency, I had to develop apps for people deployed to Afghanistan. The only computers they had access to were running locked down Windows XP with no way to install anything new. They were stuck with Office because it was already vetted and installed. Therefore I was stuck with Office too, even though I'm a Linux guy. I got a fair amount of kudos building some real frankensteins for them purely in VBA.
- appplication 3y agoThis matches my experience as someone once deployed to the Middle East. I automated much of what I could using VBA on entirely airgapped XP computers.
- rprospero 3y agoHaving been in a similar, but not the same, situation, I resorted to an HTML file with some JavaScript code in a script tag. Was IE locked from running, even though the machine was air gapped? Or did you find VBA more convenient that JavaScript?
- gonzo41 3y agoI've done this too. with modern browsers you can do a lot with JS and HTML5 without much of a backend.
- mdaniel 3y agoespecially since given IE on XP, I bet `new ActiveXObject("Here.We.Go")` would allow some truly <s>spectacular</s> horrifying things!
- enasterosophes 3y ago> Was IE locked from running, even though the machine was air gapped? Or did you find VBA more convenient that JavaScript? At least partly it was due to being in an environment where other people I worked with were already using VBA. They suggested VBA for the task, and they were able to help me get up to speed with it fairly quickly. And at that point in time I was still young enough to be open to trying new things just for the sake of it, my own opinions were not fully encrusted yet :) I did dabble in javascript for a simple webapp for one small project, but that was kind of a tangent to what we usually worked on.
- wly_cdgr 3y agoCos they already know it and it's good enough to accomplish their goals. Nobody gives a dying duck about your new/better thing unless it makes their miserlable office slave life slightly more bearable not in the long term, not in the medium term, not even in the short term. In the IMMEDIATE term.
- Aloha 3y agoThe real answer as pointed out in this document is simple - IT Security and Administrative policy in non-technology companies trends towards restriction and justification rather than permissiveness. I work in a role that develops air gapped custom communications system, my title is engineer - and to that end I have a broad cross domain knowledge - including traditional system administration tasks. I have to go thru special justification to get local admin to install software our company makes. T here appears to be a future that will prevent me from using a thumb drive to move our software and configurations from my work PC to our systems - when we ask IT for a solution, they tell us "us the approved file sharing mechanisms" - which are basically limited to OneDrive. On top of all of that, per the written policy, we regularly violate written policy - for example distributing software requires LOB executive permission - which in the context of our larger company would be CEO level - and this is just one glaring example. IT is either clueless or doesn't care and no one outside of my LOB cares - or is aware - and nothing will change until security policy prevents a major project from delivering on time.
- jojobas 3y agoImplementing prohibitively tight security and mandating that any files are shared through a product with security footprint of Onedrive is crack-smoking-monkey level of insane.
- GuB-42 3y agoFrom an IT security perspective, maybe that's insane. From a job security perspective it makes a lot of sense. That's the “Nobody ever gets fired for buying IBM” idea.
- Aloha 3y agoThe most important part about OneDrive is it offers a CYA level of monitoring and control. We're doing 'the cloud' wrong, rather than it being a way to leverage BYOD and easier access to information, we're going the opposite way.
- jalapenos 3y ago
- nunez 3y agoBecause it's cheaper/easier than replatforming for many businesses and there are still people that know it and are hireable
- j45 3y agoSometimes it’s the only thing available in a very locked down enterprise or corporate environment and the pace of implementing something new is too slow.
- theodpHN 3y agoPath of least resistance.
- richsu-ca 3y agoThe language, the object model, and the IDE combine for a fun, highly productive programming environment.
- mcbishop 3y agoVBA is a lovely language, that supports object-oriented programming (with composition... no inheritance). It has deep access to and control of Excel. It's mature and stable (Microsoft is no longer significantly changing it). "Real programmers" hate on it largely because of all the amateur spaghetti VBA code written by the business people (that the programmers are occasionally asked to debug).
- emodendroket 3y agoI mean I think it's fair to look askance at any environment that includes misfeatures like `On Error Resume Next`.
- layer8 3y agoYou mean like most shell scripts? VBA is no different from Bash here.
- emodendroket 3y agoI wouldn’t consider that much of a defense!
- MagnumOpus 3y agoOptions are good. Resuming on error can be just as much a feature or flow control paradigm as using exceptions for flow control. VBA gives users options. If you want a straitjacketed 1990s predeclared OOP language, you can use Option Strict and Option Explicit and forbid Goto statements and On Error statement. If you can deal with ambiguity, you don't need to. And of course even a a language with misfeatures is better than the VP of the IT Dev Silo giving you the choice of spending $2m and a year or doing your work by hand.
- emeril 3y agohey, I deliberately use that all the time lol
- blincoln 3y agoCounterpoint: VBA is an awful language, other than its access to/control of Excel, Word, etc. It's full of bizarre quirks, like <i>control characters in code</i> that are localized.[1][2] Want your code to run on non-English installations? Better dynamically build all of the strings that are passed to that type of function using placeholders like Application.International(xlDecimalSeparator), making your code much less readable. When code breaks for this reason, it does so with incredibly unhelpful errors, and it is literally impossible for the developer to reproduce unless they know it's a potential problem with VBA, and then they have to switch their interface language to one they potentially don't even know to reproduce the problem. In Word, at least, probably half of the most useful functions (insert a paragraph after the current one, etc.) will break if you use them on the last paragraph in a table cell, requiring tons of spaghetti-code workarounds. Want to pass around a string of text that contains multiple formats, the equivalent of referring to the innerHtml property of a DOM element? Good luck with that, unless you want to do it all using hacky scripted-select and copy/paste. Someone in a parallel thread compared it to Bash, and I actually agree with that. No one should be writing anything complicated in either language. [1] https://stackoverflow.com/questions/20652409/using-vba-to-detect-which-decimal-sign-the-computer-is-using https://stackoverflow.com/questions/20652409/using-vba-to-de... [2] https://stackoverflow.com/questions/29832281/vba-range-function-suddenly-accepts-only-localized-arguments-pt-br https://stackoverflow.com/questions/29832281/vba-range-funct...
- michaelteter 3y agoVB(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 scenarios. And when you outgrew that, you must have had enough money to pay to scale up to a "real" solution. Without a doubt, a HUGE TON of money has been made using VBA based systems. From my own experience (as a mostly-outsider finance dev), my biggest Excel/VBA rewrite was for a company that made $$$$ before, during, and after 2008 doing credit default swaps. Sure the Excel workbook took 5 minutes to open (before I rebuilt it), but VBA was doing a lot of heavy lifting. And the people with the knowledge were making big bucks for the company and themselves with bonuses. This is really a lesson. Whether the tools are ideal or not, what matters more is if they are accessible to people not specifically trained to use such tools. Again, that's why Python has become #1 outside the client web browser. It doesn't mean the tools are the best, but it means they do the job and are accessible.
- asdfman123 3y agoFuture civilizations will marvel at the intricate grandeur of our Excel spreadsheets
- guappa 3y agoThey won't be able to read our media, and if so they won't be able to decode the excel format.
- personalityson 3y agoExcel format is just a zipped collection of XML files
- orthoxerox 3y agoThat's the new one. The old one is 90% direct dumps of C++ structs.
- Dwedit 3y agoBecause it's basically VB6
- Pxtl 3y agoVb6 at least had "on error goto".
- qsdf38100 3y agoVba has "on error goto".
- Pxtl 3y agogoogles Huh. I distinctly remember working with VBA-based systems like 20 years ago where that was a massive difference - like, I'd been writing code on mid-'90s VB4 and it had "on error goto" but VBA didn't like 10 years later. But maybe it was specific to one or two VBA-based platforms. Either way, it was super infuriating since it meant the only non-catastrophic error-handling possible was "on error goto next" and then manually checking error codes.
- masteruvpuppetz 3y agoI've been developing VBA macros since 20 years. It's largely the same language as it was when I first started. I've made lots of automations with VBA but nowadays, I've almost fully moved to UiPath RPA. I think RPA is very underrated and it should be used in place of VBA for complex automations like button clicks, data entry, scrapping, etc.
- RugnirViking 3y agointeresting, looks promising. ive made both vba and python automated scripts for button clicks etc in other software in the past, could come in handy in future I imagine to have a more dedicated setup. Is UIpath free?
- masteruvpuppetz 3y agoyes, you can download community edition
- sancarn 3y agoI do RPA from VBA personally using IAccessiblity. See stdAcc (https://github.com/sancarn/stdVBA/blob/master/src/stdAcc.cls https://github.com/sancarn/stdVBA/blob/master/src/stdAcc.cls) and an example (https://github.com/sancarn/stdVBA-examples/tree/main/Examples/BrowserAutomation https://github.com/sancarn/stdVBA-examples/tree/main/Example...). You are basically doing the same as what you'd do in UiPath, by the looks of things. Just a slightly different flow.
- asdfman123 3y agoThe article linked within the article, "Your Organization Probably Doesn't Want To Improve Things," is interesting because I know *exactly* what the author's problem is. The problem is they're an intelligent person falling short of their potential. As understandable as it is, raging against people around you for their shortcomings isn't going to help you or them. You've got to do the hard and scary work of grinding your way up to get to where you belong.
- emodendroket 3y agoNo matter what lofty heights you achieve you're never really free of external constraints.
- asdfman123 3y agoThat's true, the stupidity of the workplace will always exist. But like I know that pain. I've been there before. After getting into FAANG there's still plenty of meaningless work but at least the people are smart.
- keepamovin 3y agoCouple of years ago someone I know in manufacturing asked me to add a "cell hiding" encryption function to an Excel spreadsheet (because they still use excel spreadsheets for showing redacted price information to clients), that they could unhide when they wished to view the data themselves. Quite a clever solution they use, I thought. I implemented a simple XOR based encryption in VBA and it worked. So, I imagine that's just one of many real world business use cases. I quite enjoyed the bizarre deep dive into VBA and Excel tho
- lencastre 3y agoIt started as a simple way to automate the boring stuff in Excel. In my very very junior days working I had to compile a neat dashboard from different sources which came in Excel format. Sometimes these workbooks had some mistakes, sometimes they were forms that were mangled by production managers (this before password protection and fixed layout forms were a thing — eeeesh),… it was mindless fixing, converting text to numbers, wrong date formats, aligning, copy pasting of hammer values from several files into a master file then printing it and dozens of forms onto an inkjet for the monthly operations meeting. What started as a full week job becomes 2 hours + printing after VBA started automating. The offending mangled forms had to be resent to the feeder managers with a note if they need additional help/advice how to overcome the limitations of the forms…).
- uxp8u61q 3y agoBecause 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/overview/office-add-ins 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 run a quick-and-dirty script once to fix something right now. I discovered Script Lab (https://learn.microsoft.com/en-us/office/dev/add-ins/overview/explore-with-script-lab https://learn.microsoft.com/en-us/office/dev/add-ins/overvie...) while writing this, so maybe that'd help.
- janci 3y agoEDIT: I did not see the script-lab mention at the end of your comment. Microsoft Script-lab will allow you to do just that. https://www.microsoft.com/en-us/garage/profiles/script-lab/ https://www.microsoft.com/en-us/garage/profiles/script-lab/ The other issue: it is not trivial to share an addin to end users. You need to publish it to marketplace or sharepoint. Sideloading requires SMB server and GPO. However there is an option that is not mentioned anywhere: it is possible to embed it in a document and it will install when it is open for the first time (after user confirmation).
- aspaviento 3y agoJS Add-ins are way limited than VSTO Add-ins. With the former you are limited to a side panel and add buttons to a specific section in the ribbon while with the VSTO you can even customize views with region forms.
- TeMPOraL 3y ago> My main issue is that unlike VBA, I can't program it from right there in Excel. Yeah, that's pretty much a deal-breaker. On top of the obvious thing: can "add-ins" be installed by unprivileged users, without involving the IT department? Can they be embedded in the spreadsheets? A "no" to the former is a real deal-breaker, but a "no" to the latter also hurts adoption. Nice thing about Macros and VBA is that, security settings notwithstanding, every instance of Excel is capable of running them out-of-the-box, without making the user install anything extra.
- emodendroket 3y agoThere have been several half-baked efforts to introduce new kinds of automation into Office but none of them have all the functionality of VBA. But I guess working on that again is too boring and unappealing so we get flavors of the month instead.
- ekianjo 3y agoInertia
- IYasha 3y agoBecause it's the only option? When I was writing my PHD thesis in Word 2003, there was no other possibility to generate list of references than to write the script yourself. So I did. This doc is still lying around somewhere and probably works. While not very pretty, still more readable than Perl or Python :D
- rkagerer 3y agoBecause it's fairly simple and it works.
- kagevf 3y agoI used it recently because it's the built-in scripting option for Outlook. I found myself writing the same emails over and over again, so I automated the writing with VBA, using input prompts for the variable parts. I'm not familiar with the available objects, so leaned heavily on chat gpt for that. Associated the script with a macro, then linked to a menu button and now I can quickly compose an email with a shortcut key.
- teaearlgraycold 3y agoI'm glad I've worked primarily in early SV startups. None of this BS to deal with.
- 0xpgm 3y agoWith the interconnected nature of modern life, that BS probably touches an important part of your life
- totallywrong 3y agoWhy BS? It appears to be incredibly useful for a lot of people. You don't seem to have had a long career, let me tell you that it pays to keep an open mind.
- lobochrome 3y agoBecause it is just awesome!
- guender 3y ago[dead]
- system2 3y agoI work with accountants. An average accountant is 50+. If they learned something like VBA or used some old friend who created automation, they stick to it. You can't explain what JS is to them. VBA just works.
- account-5 3y agoNo choice. I've learn VBA and Powershell only because they are the only things I have access to at work that allows the computer to work for me rather than the other way round. In the past I've run autohotkey portably to automate corporate systems that seem designed to maximize the number of clicks to get anything done, and for "glueing" systems that don't speak together. I'll learn anything that makes my life easier.
- replwoacause 3y agoI love PowerShell, it’s a fantastic language.
- account-5 3y agoI agree, it's massively undervalued. Sure the syntax isn't for everyone but out of the box it has much of the stuff in it that on Linux I'd be reaching for awk, jq, etc. Not to mention being able to pull in stuff from .net and other windows things. I can't fault it.
- Havoc 3y agoBecause MS took a decade to get python into excel…and then promptly implemented it in a cloud fashion that sends confidential data out to their servers so I can’t fkin use it for work
- hkgjjgjfjfjfjf 3y ago[dead]
- menotyou 3y agoLet'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 Technology teams and SMEs Some REST calls use javascript encoded as strings Others require html embedded in json embedded in xml Database tables aren’t queried by name but by GUID. There’s no documentation of which GUID relates to which table/process.*" Quite a lot of things became so outragedly complex no one outside of the IT bothers to handle these, and sometimes not even inside IT. It started with AJAX where suddenly half of the development effort went into designing frontend code and backend services, which honestly does not even touch the end users automation problem. And it went further downhill afterwards. UIs nowadays look modern but are generally as user hostile as the technology stack used to produce these. In Excel my UI is just "there", I have a nice code generator aka as macro recorder, no IT department questioning my authorization to do something nor does not have time or budget to help me with my business problem. So VBA is the workaround for users around the IT department. Not perfect, but better than what you would get else.
- tinus_hn 3y agoSo the answer is: Because it is the only programming language Corporate can’t choose not to install. The wonders of ‘Enterprise’, it amazes me when people bring it up as if it’s any kind of advantage or excuse.
- MichaelZuo 3y agoHuh? The parent clearly points out that it's much less effort and hassle to get an 80% solution. Who wouldn't want to spend a tiny fraction of the effort to get 80% of the outcome?
- TeMPOraL 3y agoYes. But 90% of "effort and hassle" is dealing with IT department bullshit. Excel/VBA lets you sidestep that entirely.
- unixhero 3y agoIf you are in a locked down corporate dragnet. You want to write some code, automate something or compute something. VBA may be what you have available to you.
- jmkni 3y agoAlso at this point, probably everything that can be done in VBA has been done already, so there is definitely a code snippet out there on a forum somewhere for whatever it is you are trying to do.
- gonzo41 3y agoIt's all because of change control. The moment you have to deal with it as a non central IT dev or upskilled BA, you hate the experience and then start getting creative with the tools you've got. And then 20 years happens.
- benj111 3y agoI read essays from 40 years ago, about what the office of the future could and should look like. There always seemed to be an assumption that you would empower the user with tools. I suppose VBA does that to an extent, but it seems like we haven't moved the idea forward in 30 years. I'd like to say it's because it's 'good enough', I suspect it's more a hold over from an earlier time that hasn't been eradicated yet.
- orthoxerox 3y agoAn on-prem clone of Airtable would be a much better replacement for 99% of software that is written in Excel VBA, but: - you have to buy it and justify the expense, but your company already pays for Excel - if it's FOSS, then your cybersecurity will want to scan it and demand you fix every single "critical" CVE, but they don't dare block the use of Excel - you have to run it on a server, so you need to buy a server as well, but Excel runs on desktop machines and you probably already have a network share, too - the server will probably be locked down tight and have no access to other servers, while Excel running on desktop machines has the level of access of the user running it - the IT will try to lock down the server-side installation and grant you as little rights as possible (please submit an enhancement ticket if you need to change the data type of the column), but they can't tell you what you can't do in VBA I'm not an SME, I work in IT myself, but the amount of self-inflicted hurdles in modern enterprises is staggering. I run a large team that develops ETL jobs, and I needed a database to cross-reference tickets vs jobs vs source systems vs releases vs subteams, because of course no existing system knows all this. Ended up running this in Excel with some Powershell scripts: one to scrape JIRA, another to scrape Airflow, the other to access the target database under my personal account and download the list of tables. Still easier that doing it by the book.
- turkishlurker 3y agoI've been in manufacturing for ~13 years across 5 different organizations. There'll inevitably come up a spreadsheet use case where you'll have to execute a well defined series of steps on a recurring basis (and some of these steps may not be possible using the built-in functionality alone). Which is where VBA comes in. I've sometimes wondered what I would do in the absence of VBA and come to the conclusion that a) I'd be forced to complete a painstaking task "manually", and likely committing the occasional error in the process, not to mention all the time I'd have "wasted" b) In the case of "optional" tasks (whatever that may mean) I'd have had to give up on whatever functionality/feature VBA enables and some level of detail/sophistication/speed would thereby be lost. To get a bit more concrete in terms of use cases, any spreadsheet task involving a bill of materials or having to do with stock management is probably ripe for some VBA enhancement. I am aware that it is looked down upon by some, but advising against VBA in favor of Python or some other "proper" tool that calls for an IDE is a bit like telling someone who wants to take up home cooking to get a fancy Japanese chef's knife set plus a sharpener instead of the good old all-purpose knife he is certain to have lying around.
- pillefitz 3y agoMore like: Obtaining a japanese chef's knife, getting a permit to carry it and forbid your friends to use it.
- pharmakom 3y agoPlease, please Microsoft start pushing F# as an alternative to VBA!
- eurekin 3y agoUpon reading answers, I wonder how much, if any, market is there for VBA only (self bootstrapped?) tools that bring modern development practices into it (version control, testing)
- agumonkey 3y agosmall trivia: long ago I had to massage a db dump made into excel files, so I hacked up a DSL to write business rules validation / transformation, all in VBA (where I also learned that the object model included some cute transparent delegation subtype thing). C-suite decided we needed more speed, so they brought up two seasoned engineers, one of them all about .NET interop. But doing Office logic outside of VBA/Office brings a lot of pain (excel embeds type in formatting IIRC) so he ended up recreating a mini excel object, still hit performance issues and ejected himself from the project. tl;dr I was surprised how "pragmatic" it ended up.
- al_be_back 3y agoWhy? the obvious answer is that businesses still make heavy use of Office apps like Excel, and VBA allows for extending/customizing files-as-micro-applications. Important to note that office apps and Macro-tools were essential before the Web and Mobile apps became popular. Businesses have to carefully balance between Adopting the Newest tech/fad and Growing their business, and Staffing/skills.
- runnr_az 3y agoI always find these discussions fascinating because, despite being a developer for like 25 years, I have absolutely no idea what you guys are talking about. I know that somehow business is all run on xls, but practically it’s hard to understand what that means. Something something Salesforce
- TrackerFF 3y agoI had to develop a simple CRUD interface for some of our analysts. The immediate problems I faced was: 1) The analysts wanted every (CRUD) step to happen within excel - excel was indeed going to be their interface, so I needed something which I could launch from within excel. 2) The IT department refused me to grant command line access 3) The IT department refused me to install non-approved dev tools. To get them approved, would potentially take months. 4) The DB admins weren't too keen on letting me add a new DB to the existing Oracle DB. The IT department weren't too keen on me doing my own DB (see step 3) Hell, just getting new add-ins to excel requires me to BEG the IT folks. And if I'm lucky, the add-ins will just suddenly appear. Will it take a day? a week? a month? Who knows. So keeping all those things in mind, my only real alternative was VBA. In the end I managed to get some permatemp solution up and running, which the analysts use once every two weeks.
- lucidguppy 3y agoWTF!? Everyone needs to seriously look at DDD again. You want a product? - Small team composed of a few developers, one or two SMEs, one or two DEVOPS. - SMEs teach the devs the domain language. Explain requirements in gherkin language or equivalent. - Devops hand hold the developers to get it into production. (Devops guy can probably be split between 2-3 teams). Many SMEs want to work their problem, not code. You're helping them. VBA is anti-technology. There is no version control, there are no tests, automated integration tests? HAH! *PS: "You build it you own it" Is wrong. You need a small "meta-programming" team that makes sure the teams have the tools they need to own production without their brains exploding. Perhaps these meta-programming teams can be split among a few corporations - as you don't really need them there all the time.
- Aeolun 3y agoYou can use JS in basically all the places you can use VBA right? It's available in every browser.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- francisofascii 3y agoJust recently we had a meeting with a client that demoed their current business workflow process. One of our client's very clever business users created a hacky but also amazing VBA solution for sending emails, assigning work, creating reports, etc. It works just the way they want it, and our team was there to replace it. Made me sad, because our solution will cost a fortune, won't do half of what this guy's solution does, involves a third party SASS solution with a very limited API, and so it will cut him out of his ability to customize it.
- layer8 3y ago– It’s built in. – The IDE is built in. – The syntax is beginner-friendly. – It’s stable and doesn’t change every six month. – It’s well-documented. – No build steps, it just runs, and fast. – It’s resource-efficient (CPU, RAM). – You can easily create dialogs and forms using the built-in visual GUI builder. – You can break into the built-in debugger from your Office document. – If you want to get fancy, it has interfaces and classes. – You can call any win32 function and use any COM object.
- lnxg33k1 3y agoI think I just read the best reply ever
- ncjcuccy6 3y agoBut typescript has "using" now? How can VBA still be so popular?
- layer8 3y agoVBA supports automatic cleanup via Class_Terminate. :)
- nulbyte 3y agoAll valid points, but I think the biggest reason is: - It's what's available. There is a bit baked into this statement which the article breaks down further: - Companies won't approve anything else in the hands of ordinary users - Companies' developers are too busy with too high priority items And some things not mentioned in the article are also baked in: - Even when developers get around to a project that could replace VBA, they don't understand the project, underestimate the time and resources required, and deliver a subpar product as a result - Companies lay off people doing work IT and developers can't be bothered to support with no real plan other than overburdening the remaining ordinary users with extraordinary problems
- 7thaccount 3y agoVBA serves an awesome niche. I once built an awesome simulator that did some pretty complex optimization stuff. The main sheet had input cells for the user, a couple of radio buttons for toggling certain features, and a button to fire off the built-in Excel solver plugin and pull certain values from that process and display it all on a GUI on the first sheet. It took me just a couple of days despite zero VBA experience and most importantly I could send it to all of our customers who then had a full simulator that they could play with alongside their engineers. They didn't have to install anything (just click a button within excel to add a plug-in). Simple simple.
- jbjbjbjb 3y agoThe clean solution is quite simple - if you don’t want non IT people writing software then buy a product to solve the issue or hire some experienced professional developers. The problem is that a lot of time the clean solution isn’t feasible because of constraints or culture and you end up with something in the “dirty” solution end of spectrum.
- zubairq 3y agoI agree mostly with the article, VBA doesn't have to get past the pointy haired bosses or the purchasing and compliance departments!
- culebron21 3y ago16 years ago I developed some apps with MS Access that interacted with MS Outlook. It was rather easy given the integrated IDE, debugger and being able to create forms and call a CLI app (zip). I contemplated suggesting my managers to build something serious with some web tech -- also ubiquitous and easy to deploy PHP -- and it looked a lot more complicated right away! Later, I used to be Django developer, and I think it would be even harder to deploy and maintain. The only inconvenience I recall was some functions had tedious API, arrays/lists were hard, had to be created like kinda Collection.new(...).
- orthoxerox 3y ago> The only inconvenience I recall was some functions had tedious API, arrays/lists were hard, had to be created like kinda Collection.new(...). Imagine what people would do if VBA was a better language and had a better IDE that wouldn't scream at you every time it found a syntax error in your code-in-progress.
- jason0597 3y agoI work as an Equipment Reliability Engineer at a nuclear power station. The only programming we are allowed to use is Microsoft Excel Macros, nothing else. There’s a reason why VBA is still alive.
- ethhics 3y agoThere is at least one semiconductor test platform which uses Excel workbooks as the programming interface. Automotive chips going in to new vehicles today are being tested for functionality using Office 2003 and VBA
- 1PlayerOne 3y agoYes. Excel macros mostly these days. Used to do Access database projects but they are slowly being phased out by Power BI.
- J_Shelby_J 3y agoMicrosoft added python and they have office scripts that run JS. But the functionality is locked to higher tiers of 365 accounts. So I guess VBA is still the king.
- hnthrowaway0315 3y agoSo far it is still the most convenient tool to automate MS Office, and you can do a lot with COM.
- Loxicon 3y agoI worked for large companies as an excel modeller some years ago. Excel was my world. VBA is built in. That is the reason. Its the same reason emacs users use elisp.
- owlstuffing 3y agoYou may as well ask, why do people still use JavaScript?
- ubermonkey 3y agoThe real "holy shit" moment in that link is the fact that this org was still all-in on Lotus Notes well past the turn of the century. The writing was absolutely on the wall about Notes well before the Y2K panic. Staying on that platform when the world was passing you by, even if you couldn't get exactly the same functions in Outlook/Exchange or whatever else you slotted in, was foolish and honestly constitutes professional malpractice for whomever made that call.
- melagonster 3y agodo we have another language can easily control Microsoft office? I mean, it is possible to perform analysis by another tool/programming language, but what if we need to control PowerPoint?
- sancarn 3y agoActually, every language in theory. At least any language which can use COM APIs can interact with PowerPoint. Ruby, Python, NodeJS, C, C++, C#, Java, Rust, ... Pretty much you name it and it can control powerpoint unless it is sandboxed.
- melagonster 3y agothank you,I did know this!
- larodi 3y agoI find myself thinking about Excel, and spreadsheets (electronic tables) as a whole, and the fact than only few people outside of it actually understand how oldies got it really well with reactive-functional programming in the spreadsheet language. It is what React/Angular is struggling to get right with more than dozen releases so far. Also so many people fail to understand why the spreadsheet is so convenient to end users, and as a result of this failure - provide sub-par UIs which actually make thing more difficult, not easier. Sometimes one has to make a step back and understand that grannies did things right, even though they didn't have graphical UI - business was still running back in these early days, and actually what businesses need for most of the time is tabular view with options to do reactive functional calculations on top of it. Ask your SME friend and he'll confirm it.
- 4star3star 3y agoSo much of the effort put into web development is in presentation. You're right - if you just need the data, it's hard to improve on the spreadsheet.
- jimbokun 3y agoExcel is arguably the best end user IDE ever invented.
- nobodyandproud 3y agoMicrosoft is pushing Python for Excel and JS for add-ins.
- personalityson 3y agoProblem is you edit Python code inside the cells, there is no IDE for it (from what I've seen, haven't tried it yet)
- ecshafer 3y agoI think its really surprising how so many corporate IT departments are awful at enabling employees. You can see it a lot in /r/sysadmin where they complain how they got some crappy solution working "great" but their users refuse to use it. The average employee at a F500 company hates their IT department. All they do from their perspective is make it harder to do their work. This is why you see all of these VBA scripts.
- asow92 3y agoThis is all beyond the scope of VBA, but: Don't get so emotionally invested in tools because they're just tools at the end of the day. The business doesn't care what tools are used so long as they do their job. Also, knowing how to navigate a convoluted tooling systems ensures your job security, so why are you complaining again?
- sancarn 3y ago> so why are you complaining again? Because a job that would take 15 minutes turns into a 3 hour task. It might surprise you but some people actually enjoy their job and ticking off tasks :)
- thrownaway561 3y agoCause you can open, write and deploy the code right from the document itself. There is no external tools needed. Everything is baked in and works. I hate VBA with all of my hearts, but I'm going to use the tools available and with less resistance.
- onetimeuse92304 3y agoMany VBA people are just SMEs who needed to spice their work with a bit of script so they learned one thing they had immediately available to them that could be used to solve their problem. Many of these people do not think about themselves as developers. They have primary responsibilities outside of IT structures which usually means that "more professional" tools are not available to them. They invested substantial amount of effort to learn the language and are locked into the platform because everything they know about programming, every tip, every trick, every solution to every problem is all about Windows, Excel, VBA, etc. and they would have to essentially start from scratch if they wanted to do anything else like Python.
- sancarn 3y ago> they would have to essentially start from scratch if they wanted to do anything else like Python I do tend to disagree here. It really depends how invested they are with VBA. Many VBA skills are highly transferrable to Python and other high level programming languages. I was fortunate to have experience with multiple languages from the start, but many of my colleagues have programmed in other languages other than VBA after learning VBA only to begin with. From Ruby to Python and beyond.
- tmnstr85 3y agoPowerShell was (and still is) the go to for me in any M$FT shop. People like to group VBA and PowerShell together but I am amazed by the vibrancy of the PowerShell community and the deep history it holds. PowerShell releases are frequent and I'm excited about what I continue to see and hear being developed.
- gold7777 3y agoSomeone works on an Excel file every day and reads an article about how they can make their job easier with automation. The language and IDE are built in so it's easy to get started. It's also easy to distribute since anyone with Office can run it.
- wg0 3y agoIs VBA insecure, not usable or not Turing complete? Putting up whole Postgres (or SQLite) with a programming language on top (Python, Ruby or something else) is maybe more expensive, has more and different operational concerns and might not be necessary at certain scales?
- indymike 3y agoVBA has a few interesting things in common with Javascript: 1. The development environment is already installed. 2. The platform does a lot. Being able to program using Office components or program using browser components gives the programmer a lot to work with. 3. The platform extends into a "real" programming environment - VBA is a gateway drug to C# and all the other MS developer tools. Just like learning JS in the browser eventually turns into, can use my JS skills for writing other code on my machine? Programmable platforms have historically been really important to adoption and longevity in the enterprise. The emergence of REST APIs as features on many web apps fills a lot of this gap for SaaS.
- personalityson 3y agoSay no to clouds and dependency hell, return to VBA
- WheatMillington 3y agoIt's all I know how to use lol I'm not kidding. As a financial analyst I'm highly productive with VBA, and don't know anything else (I can do a little C++)
- deleted 3y ago[deleted]
- clausok 3y agoI'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 Caltech comp sci data analyst who was a Python superstar. The VBA was for pulling data from a database, putting it on a sheet, building some formulas, and some pretty formatting. There were even a few userforms! I teased him, "VBA? What else are you guys using over there? A cotton gin and a steam shovel?" I was startled to hear him heap praise upon Excel and VBA instead of the usual complaints. He said something that stuck with me, "Excel makes it easy to understand the dependency structure that is implied by computations. If I had done this in Python, I'd be answering questions about it all day long."
- zitterbewegung 3y agoAs I have gained experience as a developer using the right tool for the right job becomes paramount. And the lazy answer can be much better than some incomprehensible mess of ideas.
- emj 3y agoWell I agree that excel is a superb interface for many things and it helps people to understand data, to a certain degree. On the flip side; they are accustomed to the data model and when things get a bit complicated they tend to not ask questions, perhaps blaming themselves. There are things like this 3GB Excel/VBA pension forecast model from Sweden, with an 38 page user manual as well. Which does not really use Excel that well: https://www.pensionsmyndigheten.se/statistik-och-rapporter/pensionsmodellen/pensionsmodellen https://www.pensionsmyndigheten.se/statistik-och-rapporter/p...
- sancarn 3y agoVBA does have it's issues (https://sancarn.github.io/vba-articles/issues-with-vba.html https://sancarn.github.io/vba-articles/issues-with-vba.html) but it's far from the worst tool out there... E.G. PowerAutomate VB6 has a pretty big community, and https://twinbasic.com/ https://twinbasic.com/ has really helped unify VBA and VB6 communities as of late. So it might have a little of a resergence in the dev community.
- robomartin 3y ago> Why do people use VBA? Good article. What it doesn't mention is the versatility and value the combination of VBA and the various MS Office applications brings to the table for small and medium businesses. Translation: VBA, as a tools for SMB's, can make them money. VBA is often discusses in terms of Excel. However, it is available --and very useful-- across the entire MS Office suite. Over the years we have used VBA for applications ranging from engineering to business. From automated code generation (generate Verilog FPGA code based on easy-to-maintain data entered into Excel) to financial analysis and projections (example, Bass Diffusion Model product evaluation). One of the most fun applications I remember was using VBA to create a training application for dealers and customers using PowerPoint. We created a full simulation of this device (control panel with buttons and an LCD display), using VBA to run the show. This was super easy to distribute to our dealers, required no installation and everyone could run it. Of course, today it would make more sense to build such a thing as a web app. Still, VBA makes such things accessible to lots of people. You can use it with Excel, Word, Access, PowerPoint, etc. As a tool, it is useful and convenient. Most people could not care less about the, often pedantic, opinion us engineering types can have about such things. As a software engineer I wish something like Python was a first-class citizen across the MS Office suite. I know they are slowly making this happen. I haven't looked into it for a while. It seems MS wants you to have a subscription to Office 360, which is a nonstarter as far as I am concerned. I could be wrong.
- goodbyesf 3y agoBecause of microsoft office ( particularly excel ). It's just as simple as that. I remember years ago people thought that google's free office/spreadsheet offering was going to be the end of microsoft office/excel. I remember having a good laugh back then. The business world, especially finance, runs on microsoft office. I just don't see it changing anytime soon. It's amazing how entrenched it is.
- nxobject 3y agoIt's wild to think of how many general-purpose programming environments Excel now has access too – VBA, Office.js, and soon Python. Like Windows, Office seems to keep on accreting.
- isitmadeofglass 3y ago[dead]