I think it is a really good idea. Who uses VBA anyways? Or better: who likes to use VBA?
If i have a specific problem with VBA it is a hell of a mess to find the right resources to fix my problem. With python, I just do a quick search and can find nearly limitless helpful resources.
My experience is quite the opposite, VBA has saved me and my shop countless hours of manual data manipulation. I won't comment on VBA's features as a language, it is what it is, but its close integration with Excel/Word object model is invaluable.
Here's the thing about VBA. Accessibility. I think a lot of folks in this thread are coming at this from the point of view of experienced programmers. The value I've found in it is in its simplicity for the non-programmer.
I worked with a large team of super talented CAD guys and engineers, who all knew Excel and Access and their various CAD seats (ProE, Catia, whatever-thefuck, I'm not a CAD guy)... but they didn't know programming at all outside CNC and a bit of PLC stuff.
But when I introduced them to VBA with a large estimating / program management spreadsheet set we were developing, they took off like fish in water. Highly technical guys with a ton of knowledge, but sort of... trapped... in their various platforms. VBA just like, set them free. They started thinking differently. In weeks those dudes were performing small miracles with data sets and automation, and many of them jumped right off into other languages like Python, Perl, and even into c++, extending not only our project, but building modules for their CAD systems and cool stuff on the floor machine side. It was really cool to watch.
But I think Python still holds that potential as a gateway language. Even more so since there are such great resources everywhere for learning Python from no programming experience whatsoever. This is a no-brainer in my mind.
Oh I absolutely agree. Just the headline, MS considering Python integration with Excel got me all.. frothy and tingle-toed.
As an admitted and somewhat recovering Excel addict, the thought of a Python shell as alternative to VBA is something approaching electric. But then... I'll believe it when I see it.
I'm wondering if anyone else is making a leap of thought that imagines not just Python scripting integration for the Office suite, but the replacement of the VBA editor with (maybe a stripped down version of) VS Code.
Office scripting would feel truly mature with the rich editing experience and version control features of VS Code.
vba is inconsistent, in the same way R is inconsistent or javascript is inconsistent. so if you could choose another language for the back end of excel it will be one poison over another.
in my opinion, most of the annoyance seems to be from the application object model rather than the language itself. in which case, if python were to be integrated into excel but the object model is going to remain the same, i'm not sure that's going to be life changing.
the fact that vba idioms aren't as "modern" as the other languages are doesn't seem like a big deal to me. I use c# python and vba and they are v different languages with v different idiosyncrasies and it's just one of those things that I simply gotten used to. there are times I wish python was more like C# or C# was more like python but those are really just passing thoughts.
To be fair there is a J(ava)Script engine for Windows Script Host and you can use it to work with Excel object model just fine just as you can use any language that supports COM interop.
I've been automating Office since the 2000 version and I know the object model relatively well. It doesn't really bother me but that's maybe because I'm just used to it. I also try not to lose too much time on the macros. Just make them work and move on (except for those that are not for one off tasks)
I’m in the same boat as that guy - I had a sheet that took CMM data from a portable laser scanner and converted it into machine code for adaptive matching, I had a sheet that I programmed to take in a user’s input and then create a work order for my shop, tying in all of the serial numbers and pulling the correct revision controlled templates for the data inputs (a manual and terrible process before)... I had a sheet that took my company’s garbage ERP export data and then corrected and displayed it in a useful manner... I’ve done loads of projects with it. Some incredibly simple and some more complex time savers.
I love the integration with excel. As far as the language itself I think it’s a little easier to learn for beginners but it is kind of a pain to deal with daily. It feels limited sometimes but I’ve only got some rudimentary experience with other languages.
For those wondering I am a mechanical engineer who manages new product development for land based and aero turbine engines. Primarily land based turbines though. Learned VBA in my spare time at my first job.
Power Generation, not for vehicles. Vehicles would still be considered ‘aero’ because they would likely be high bypass flow with double or triple spools. Land based are just giant single spool engines. The theory is largely the same.
That land based turbine I linked would run with another one beside it (so a pair) and burn natural gas for about 40% efficiency - the exhaust heat is actually dumped into a single steam turbine though and you can get efficiencies in the 60% range. Right now, the 50Hz version of that engine is running in France and holds the record for the most efficient combined cycle power plant on the planet at 62.22% - which is insane. Cars are only in the low teens iirc.
Edit: and not trying to hijack the thread at all, apologies everyone
I've been using it since Office 2000, so for quite a few different things. The last was, we got loads of data (like one database record per worksheet) in separate workbooks. So I just copy all that data in a new sheet as a nicely formatted table.
I get what you’re saying. I think OP meant people would say “Just use Excel, it can do whatever you need with VBA” but now “just using Excel” would actually be legitimate because of the support for python.
The point was your trying to use excel for too much as it is and should invest in the proper application for whatever it is you're trying to force excel into doing.
The beauty of excel is the wide applicability. You can use it to manage a grocery list as well as generating sales invoices as well as running monte carlo forecast simulations. Yes, there are better grocery apps, better invoicing tools and better forecasting apps, but excel does all of it and everyone knows to use it. Various services can import and export excel (at least as CSV) and most business users are fairly comfortable using it to do what they want. Unless a company is large enough to be able to manage an IT team (or manage a vendor), its really not an option to write your own application for every which way that a company uses excel.
743
u/1roOt Dec 14 '17
I think it is a really good idea. Who uses VBA anyways? Or better: who likes to use VBA?
If i have a specific problem with VBA it is a hell of a mess to find the right resources to fix my problem. With python, I just do a quick search and can find nearly limitless helpful resources.
So go python!