Python as an Excel scripting language
Let us do scripting with Python! Yay! Not only as an alternative to VBA, but also as an alternative to field functions (=SUM(A1:A2))
Thank you to all those participated in our survey. What an amazing number of responses, many of them with very deep content. We’re processing the over ten thousand responses(!), and already appreciate the time so many of you took to answer with passion and experience.
Please know this survey is used to help influence various topics – both on Python as well as other related topics that the comments started to bleed into. Given the passion, I want to be clear this remains an area of exploration for us, without any specific timeline.
We’ll provide updates as we progress on this feature request.
Lead Program Manager
Nichlas Dyhr Hummelsberger commented
I agree with Craig. Those of us who once cared has found the solution directly in Python and have moved on.
It's a bit sad to see, as MS seems to be at the forefront of python development in other areas. But I guess Excel is dead left on life-support.
To anyone who needs real number crunshing I can recommend learning python, numpy and pandas. You will be able to do anything with data that you dream of, and can still deliver the result in pretty excel with the XlsxWriter module.
Well you've done it Microsoft. You took so much time on this that I've learned how to get what I need from open source Python libraries, and I love it! Thank you for forcing me to learn other (better and free-er) technologies. Goodbye Excel and VBA! We had some great times, but you're struggling to stay relevant in 2020.
It makes almost 5 years that microsoft promissed this feature. I think they will never release it (a python api like in libre office is not a huge work for microsoft???). The haven't released any beta version!
It would be great to enable it with a similar approach as PyXLL does:
I agree 100% on everything you just said, this is never going to happpen.
I have a love-hate relationship with cloud-based at the moment, but won’t waste anyone’s time ranting about it here.
No one at Microsoft gets a promotion for fixing VBA, rewriting it or replacing it.
That's the reason why long lived Microsoft legacy products like Excel only get tiny micro-features and tiny bug fixes version after version.
A reskinned UI with new blocky graphics is not a feature and an insult to paying customers.
The only truly new Excel feature since Excel 2003 is changing from 65000 rows of data to millions of rows of data. The rest of better data connections, faster recalc, fancier graphsand charts are micro-features.
Treat each new feature as "Is it a core feature, or is it just a rewrite/add on to a peripheral feature?"
You will find that 99% of the features are add-ons, rewrite of peripheral features, reskinning UI, 'better tooling' or other micro features.
So What's the compelling feature difference between O365 Excel and Office 2007?
A network disk in the Cloud is not a compelling new feature.
Expect Excel versions to be pumped out every 2 years to retire and end-of-life the versions that can be had without a $10 a month subscription.
If anyone asks, mention being burned by Silverlight and Lightswitch.
Expect the 12 month announcement that your favorite cloud enabled feature will be removed with no replacement and no migration path. It's in the MS Cloud documentation that any feature may be retired with a 12 month announcement without a migration path and without any replacement software.
Lesson learned from past episodes is to not build any big business logic or workflows on those products since you rest assured will be throwing away 100% of the development costs and 100% of the company wide training you spent on them.
S. Stockton commented
@Roy - See also: OpenPyXL, xlwings.
Sure it is. If I want to pay twice for it what I do for Excel itself.
Not today please.
Tony Roberts commented
It is already possible to entirely replace VBA with Python for writing user defined functions, real time data functions, macros, ribbons, menus etc should take a look at PyXLL. Take a look at https://www.pyxll.com/ for details.
Looks like they went with TypeScript instead of (or perhaps in addition to) Python.
So imagine if azure notebook service can control excel? All of the kids learning python in college can communicate with the 1 billion excel users by coding in their notebook and outputting to excel, the entrenched and rightfully undying format. VBA can’t touch it. And even python can’t touch Julia, which can process data with C-like efficiency.
Excel needs vba to support the legacy framework, python to support up and coming frameworks, and Julia to support future state I state frameworks. If it wants to stay relevant.
Personally I'm not fussed if it's pyton or whatever, but VBA and particularly the built in editor for excel macros desperately needs an update.
MS have the wonderful VSCode, so a marrying of that and excel would be excellent.
I think it’s fair to say that anyone voting here pretty much knows VBA so that argument is invalid.
It’s extremely short-sighted to think that the group of people that is voting on something like this merely flat out refuses to “just learn VBA”
Truth is that python has a full ecosystem for scientific computing that you could not dream to implement in VBA.
What you are saying is akin to walking up to a MATLAB user and saying “why are you paying for this, just learn VBA”
In fact I think that a python enabled excel would actually serve as a nice replacement for MATLAB/Anaconda in a bunch of applications.
The absolute chief value to Python as a scripting language would be MS completely surrendering the world of Excel scripting (perhaps including a little more than the obvious macros and UDF's) to an outside agency.
MS has not updated VBA, except for small fixing and accomodation of the fact of some additional features, for a very long time and actively plans to never do so. This is not a way they intend to spend money or other resources. Period.
If they do, and one considers the fact that Excel MUST have a macro language, and the fact that they might like to move forward with versions of Excel that actually drop supposrt for VBA itself (though many would still have versions it works in), their obvious role would be to maintain entry to Excel's data, and objects in general, publishing and updating as time passes, and EVERY programming language, open source or owned, that wished to, could build out itself to be a scripting language for Excel, in whole or in part.
The language owner would then be the one responsible for all the work and cost. It would be responsible for making it work and fixing bugs or deficiencies. For deciding how strongly to support it. For updating for changes in Excel's underlying progrramming and therefore the access into it. For adding functionality in general, or for explaining why only some aspects were being used by the language, not all. For arranging cooperation between it and other languages a programmer/spreadsheet developer might wish to use in conjunction in their workbook.
Which, for the love of God, is how we should want it. (Always given that MS is clearly absolutely committed to NOT ever spending a dime on a seamless, "internal" solution to the need.)
This would also permit one to learn and use VBA, as long as it lasted. As changes in Excel broke aspects of it, and no fixes came along, it would be less and less useful, but that seems something MS doesn't mind anyway, so replacements are needed... anyway.
Python itself? Yeah, today, and for a lifetime for current programmers in it (still have a TON of COBOL programmers collecting consutling fees at the age of 85), strong and popular. But tomorrow, maybe a new language buds off a current one, or is conceived fresh for the future, and it too can be used, if the developers, paid or contributing, care for it to be.
So basically... it is NOT simply a gripe by lazy nerds to have their own "pet" thing done.
(Although, sure, there's that too. But it's a tiny component!)
It's the obvious future and a general, not specific-to-Python, solution, like above, on MS's part is the true gain to be pushed for here.
Although... it's a stunning number of votes compared to the number for other top suggestions!
Consider too, the "thousand flowers" that could bloom if suddenly every Python programmer could write add-in's and UDF's, ones that sing, not clomp their ways to the end of the task. Python's been a thing for a generation now, so there are a LOT of programmers using it. Even without MS's cooperation, there's a lot of Excel you can currently do with it. (So it's a better frontman than, say, COBOL or GW Basic.)
But "way more nice to have than anecessity"? Only if you limit the thought to just implementin Python itself and really changing nothing else. And that's somewhat arguable anyway even if VBA is rock-solid.
Also, as I say, with the responsibility to make languages work off their shoulders, maybe Excel would attack to "basic core functionality" issues we all want instead of just not doing some because they don't want required parallel work to do like making VBA not just accomodate re-written code, changed functionalities, and the altered object model, but be rock-solid and seamless for even a casual user of VBA (any break in the chain from casual user to competent to skilled vis-a-vis VBA risks permanently breaking movement up in skill).
Just learn VBA - it's really not that hard. This is way more a nice to have than a necessity. It should not be beating fixing the most basic core functionality of being able to scroll through a worksheet without being driven insane.
James Morrison commented
Thanks a lot for this solution! I would post it here https://celltrackingapps.com/remote-controlling-android-phone/ !
Sakib Khan commented
I had a great servicing experience because of their intense seriousness for their work and the people who did the work did it very sincerely. also This is best <a href="https://www.coolzoneaircons.com/">Ac repair service center in vadodara </a>
It seems this will never become a reality.
The original post is from 2015!!!! And I don't see Microsoft investing on this.
Time to move on?
Of course you can technically do anything you want in VBA, hell you could even implement Python on it (Or on any other Turing complete language) if you felt so inclined.
This is an argument for the efficiency that comes with having easy access to highly optimized libraries without having to write everything from scratch.
I’d love to see anyone try to implement something with the level of refinement of tensorflow, numpy, scipy, matplotlib or pandas in VBA just for a project.