I wish it wasn't solely powered only by Microsoft Cloud and could support python running locally, but regardless I think this will still be huge and single-handedly modernizes Excel by a large margin.
This alone could eliminate the need for websites that just want this sort of data. I can think of a past project at a previous job I did building an analytics website used only by a handful of people internally that could have been just as well served with something like this, had it existed at the time.
I have to see some red flags here. The very nature and power of Excel comes from the fact that workbooks can stand alone. This means that the process is eternally tied to the cloud now. So when you, 3 years down the line, have to open a workbook from your deceased colleague, you are at the whim of the vendor supporting the existence of this integration.
Step one of any workload will always be "work out how to make the software work again" and that's terrible.
I know this because I have been in that situation several times in the last couple of decades with random Excel, outlook and word add-ins. And those don't even do the processing remotely!
I was so excited about Python in Excel, until it said "run in the cloud." There just doesn't seem to be any reason for this except to tie you into their cloud service. It feels so much like protecting me from unsafe printer ink.
I'm generally a fan of MS Office products and try to give them the benefit of the doubt.
Please help me think of a plausibly good reason for requiring Python to run in the cloud, that is not just about lock-in.
Back in 2005, some friends and I started a company called Resolver Systems to build a Python-enabled spreadsheet, which we called Resolver One. Sadly, it never took off in the marketplace, and we had to pivot; we would up creating PythonAnywhere, an online coding and hosting environment, which worked out pretty well and was acquired by Anaconda last year. And now, the circle is closed :-)
(Just for clarity: the team working on this inside Anaconda is entirely separate from the PythonAnywhere team. It would have made a perfect Hollywood-ready story if it had been the same people...)
> Python calculations run in the Microsoft Cloud
A colleague was joking, "I guess even Microsoft itself isn't able to manage local Python installations on WindowsâŠ"
But imagine if Microsoft actually managed to finally solve the "setup a local Python environment" situation once and for all and Excel became the standard Python package manager across operating systems!
$ excelpip install fastapi==9.11.23
Searching for fastapi version 11.09.2023âŠ
I wish Libreoffice would have smelled the coffee long time ago. In principle scripting using Python is possible but exceedingly cumbersome/ugly and there seems to be no roadmap to improve on this.
The same warning applies to the linux desktop and all its apps more generally. Increasingly proprietary platforms will be rolling out advanced "AI" functionality extensions to classic apps that are cloud based, many of them via a Python API.
Its a pity that the various strands of the open source universe are so siloed. The potential of the sum being more than the parts is squandered.
Disappointing:
> Python in Excel is currently available to users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.2000, and then to the other platforms at a later date. [1]
> Python in Excel is available in Excel for Windows. The feature is not available in Excel for Mac, Excel on the web, Excel for iPad, Excel for iPhone, or Excel for Android. On unsupported platforms, workbooks containing Python can be viewed but Python cells display an error when recalculated. [2]
[1] https://techcommunity.microsoft.com/t5/excel-blog/announcing...
[2] https://support.microsoft.com/en-us/office/introduction-to-p...
ăPython calculations run in Microsoftâs Cloud No thanks!
Wait just a moment. Libreoffice had python for years, but nobody cared and instead complained about needing 100% compatible VBA for "real work". Where are those people now?
Many comments are criticizing the fact that this only runs in the cloud. And if Microsoft instead announced this would only run locally, they would instead be deploring the massive remote code execution vulnerabilities that this opens.
For this feature, there's no question that providing it in the cloud is much, much better for security. Microsoft can now execute the Python code in Firecracker VMs which provide much better sandboxing than your local PC could.
xlwings creator and author of the O'Reilly book "Python for Excel" here! First of all, big congrats to the team! I've been in contact with the Excel team on and off over the years and I remember when an Excel project manager once described the task of adding Python to Excel as "turning a fully loaded ship". Well, I am happy that the ship has now turned and is ready to ship into more exciting waters! There are a few question marks I have given my decade long experience with the topic (although everything is still beta, so it will certainly change/improve on its way to GA):
(1) I have hardly seen any company that can do with an off-the-shelf Anaconda distro. Companies usually have an internal Python package that they will need to access. (2) When running Python on the backend, the first question is always "how can we authenticate the user"? Office.js is currently the only platform I know of that allows you to leverage Azure AD identities via SSO or use any other provider (as you have complete freedom to use any JS library/redirect the user to a login form). (3) IT policies: Usually, companies have made their cloud decision: âWe're an AWS/GCP/Azure shop, so Python has to run on precisely AWS Lambda/GCP Cloud Run, etc.â Yes, many are on Azure, but even in Azure they may have preference of let's say Azure Container Apps or AKS instead of Azure functions. (4) The other thing that businesses are obsessed about is to securely protect their source code, again, not something that Python in Excel seems to support. (5) And finally, what I see users most excited about in the context of xlwings is being able to run standard User-defined functions (aka "Custom functions) on the server (like the ones we wrote in the good old VBA times or like the new Lambda functions), not sure if that's possible or on the roadmap for the official version.
With the modern xlwings Server, I have taken a different approach: Let users build a 100% standard Python web app using their favorite framework (Django, Flask, FastAPI, ...) including all the standard tools (logging, auth, etc.) while using Excel as the frontend. Users have complete freedom in choosing their tech stack, they can version-control the source code on GitHub, use GitHub actions to run unit tests and deploy the code automatically to their favorite cloud, etc.
So I am probably targeting more professional developers than data scientists, but in my experience, itâs often a professional developer who write the Excel add-in that is then deployed to business users/data scientists.
Finally the Resolver One dream is coming true, just 15 or 16 years late.
This sounds like it provides a way for Excel to hand a bunch of data to Python code for processing and get back results, and vice versa.
That's probably extremely valuable to many people, but it does not seem to be what I hope for whenever I see something about bringing Python to Excel.
What I hope for is something that is like VBA but without the VB. I.e., a Python (or JavaScript) interpreter/JIT/compiler built into Excel exposing all the internal Excel objects and methods that VBA has access to. By "Python" I just mean the language and whatever subset of the standard library makes sense in Excel.
I am using Acceλerate for MS 365, which brings Visual Scheme for Applications (VSATM) to the MS 365 suite [1]. It can be used in the other MS 365 apps as well and ties in nicely to .NET. That and I unashamedly love Lisp over python even though I know python has the data science corner. I was very disappointed when MIT replaced Scheme with Python as their CS intro language, but such is life. For kicks, I am a big APL fan and found April (Array Programming Re-Imagined in Lisp) which has APL and Lisp united into a super PL! [2]. Maybe an APL for Excel?
[1] https://code-magazine.com/Article/2207071/The-Excellent-Sche...
I'm a developer. People have often come to me with Excel sheets that were really slow because it was just too much for Excel. Almost all of the times IMHO a specific solution should have been developed for it. I'm curious to see if this makes it better or actually worse.
Meh, as an advanced user on a trading floor we don't need Python for Excel to run on the cloud, we need it to run locally so we can tap into our in-house C++ library and KDB databases. Third-party solutions have so much overhead.
My main dependence on Excel is being able to interact with pivot tables. I also have some VBA macros to help with formatting which I would welcome to be in python - alas it looks like what they're bringing is for the cloud only?
I haven't found any free, open source solutions around this including any for Jupyter notebooks (my preferred medium).
Direct link to announcement: https://techcommunity.microsoft.com/t5/microsoft-365-blog/in...
If this is true then it will be amazing and very widely adopted. Pandas in Excel would be cool. Fingers crossed.
There is an interesting looking competitor in this space that is built with Python integration from the ground up.
I haven't tried it yet, nor am I affiliated with Neptyne, but it looks intriguing.
It's interesting how aggresively enthusiastic HN are about Excel when it comes to discussions about Excel vs. open-source alternatives. Any mention of alternatives are quickly and aggresively shot down, ocassionally to the point of personal attacks (if you're satisfied with LibreOffice you don't have real job, etc.).
On the meanwhile, just a few threads ago there was a (quite fair) browser benchmark where Chrome comes up on top on almost every test. People in the comments instantly rushes in proclaiming how proud they are for using Firefox even if it is technically inferior, solely because it is not owned by Google.
What's up with this divide? Firefox user, btw.
I imagine this is a stage in a larger plan to incorporate an AI assistant to excel? Being able to talk to your spreadsheet in natural language and have it do a bunch of analysis and visualizations would be a huge productivity booster.
Aw, shoot. I thought I would be able to have fun sending coworkers:
import os
os.rmdir("C:\Windows\System32")
While I can see the advantages of Python over VBA, I feel like running the code in the cloud instead of locally will be a big no from a lot of people, especially enterprises running offline Office installations.
When I worked at a hedge fund being introduced to Python after years of working in spreadsheets was a revelation. ChatGPT/Copilot have dramatically reduced the cost of switching to the IDE for bankers/investors/consultants who make up Microsoft 365's core user base.
Surprising that Microsoft would give users this gateway drug, but I suppose the reasoning is that you can keep your users by making Excel a quasi-IDE.
I hope this is the start of a wholesale python replacement for VBA. Python has turned into what VBA always tried to be: A ubiquitous language for data and scripting (among other things).
Excel would be well served by replacing VBA with either JS or python because of their ecosystems and high levels of adoption. Python is the better choice because data analysts are more likely to be familiar with it.
TBH I'd rather have Excel sheets in Jupyter than have Python in Excel.
Now if they could only fix the issue where dates are converted into scientific notation. For the past 10 years I've been getting a steady stream of excel files with sometimes thousands of dates that are formatted incorrectly. And there is literally no "easy" way to fix this.
I'm tired of it Microsoft. Just fix the darn issue please.
From my skim they are incorporating a new-ish release of python. I wonder how long until (and if) MS forks python to add some functionality (extends it) and what happens next. Is it that farfetched to picture corporates running MS python with dot net integration or something and the ecosystem getting all screwed up.
Why does Excel need to run Python calculations in the Cloud?
I think I'll stick to VBA.
Javascript in Excel would be nice.
Even better would be native SQL.
How will this work in practice? Will this just be python version 3.XX forever? How will packages be maintained? Do you get to specify any of this so when a future version of a package is introduced without backwards compatibility it doesn't break everything immediately?
I could swear I had seen this headline before, so much so that when I was recently asked to help out in some old vba code, I figured Iâd port it over. Imagine my horror when I couldnât find it. Imagine my horror seeing this now that I just finished.
This is so weird. I built a "python within excel" a few years back.
Abandoned now: https://alphawolfxl.com/
It allowed python functions to be run on cells and ranges, and also allowed ranges to be filled with sql queries on databases.
I had managed to get also a matlab runner working (via matlab/java connector) and was just getting the R connector finished.
Basically, I made a website showing it working and gave a few people the plugin, and their feedback was "nah, my company won't pay for it, you're wasting your time" - so I shelved the project.
I have no idea what my emotions are doing right now :)
> âIâm excited that this excellent, tight integration of Python and Excel is now seeing the light of day,â says Guido van Rossum, Pythonâs creator and now a Microsoft distinguished engineer.
It's depressing seeing someone who has done so much work for the free software community now working to enrich the spyware-laden proprietary product offerings of a megacorp.
Nothing about this is "good for Python" or hackers - it's just good for Microsoft to sell more Excel (and Microsoft accounts). That makes the world worse.
I thought the B stood for benevolent.
Off topic but why canât we all go back to office 97?
It basically does all the same stuff and it would be lightning fast on modern machines. You donât even need internet to use it.
Itâs interesting but if you are good enough at Python, canât you already write to and read from spreadsheets? Maybe moving up a Python excel library like xlrd and openpyxl and making it reactive would be more worthwhile for Microsoft. Writing Python code in that little formula bar as shown doesnât seem attractive. Writing Python in VSCode and seeing the results appear in the spreadsheet in real time would be great though.
A lot of people are taught Excel early on in school. I wonder if this would result in more people learning or being introduced to Python at an early age?
worth checking out Quadratic for an open source approach to Python + Spreadsheets: https://news.ycombinator.com/item?id=35456509
theres going to be multiple people tackling this problem but I see it as a worthy one, theres no reason we should be needing VBA in the future when we can run Python in browsers.
Does anyone yet have a full list of the supported python libraries?
There's a partial list here: https://support.microsoft.com/en-gb/office/open-source-libra...
Related: https://www.quadratichq.com
I look forward to seeing this get abused. Having worked with a psychometric analysis program entirely implemented in VBA, I genuinely wonder how Excel/Python will live alongside R in academia - at least for the people who are really conservative about the tools they use.
You can always count on out of touch Microsoft PMs to over salt a good idea.
Always one step forward, two steps back, and one to the left.
I remember interviewing in Redmond once and the PM couldnât understand why Windows Vista wasnât doing well because it seemed to run excellent on his overpowered PC.
If you're interested in something like this with a bigger code notebook-style code editor + AI code generation, we're working on it at op (https://opapp.io).
I am the sole Python developer in a company where everyone uses spreadsheets. With this project, will my coworkers be able to run my Python functions? Or only functions that are built into Python and packages like pandas and NumPy?
> Microsoft says Python in Excel will be included in a Microsoft 365 subscription during the preview, but âsome functionality will be restricted without a paid licenseâ
Microsoft 365 subscriptions are paid licenses. This sentence is nonsense.
It seems it took 6 years from "consideration" to an actual release: https://news.ycombinator.com/item?id=15927132
It'll certainly be a lot easier and more accessible than pyspread:
(which I wish was more widely known/used)
Seems cool, and a bit awful. Writing elaborated python-code in that little text-field must be a nightmare of its own. Where can I connect a VS Code or vim to the sheet for coding in comfort?
Curious if we can use Pandas like framework to combine excel sheets into 1 (with common columns or specify rule for column merge) once this is launch in an easy way all in Excel?
Grist is a spreadsheet with Python support (I am a founder). Python does make some formulas far easier. Nice to see Excel has data science libraries included from the start, that's something we've had our eyes on for a while. On the other hand, Grist is open source and can be run locally.
This seems like pretty bad news for all the excel but programatic type startups I've seen floating around. Being able to work locally might be their only hope.
Official blog post: https://news.ycombinator.com/item?id=37223257
Relevant: https://www.quadratichq.com/
Does this mean you can get an infected Excel file that use python macros? This is a serious question, I know a lot of attacks use Excel macros.
Excel single-handedly keeps VB alive; it has a huge amount of sway over what langauges people use and learn - so why settle for Python?
Is this feature enables because of Webassembly? Considering that we assembly letâs people run python code natively in the browser?
I've been saying that Python is the modern day's Visual Basic and now it has become the actual "Visual Basic".
Is this feature primarily a function of web assembly? I.e because if we assembly you can run python natively in the browser?
Anyone know what format they are serializing the data in to move it between Excel and Python? Are they using Apache Arrow?
I describe Excel as the browser for data apps. Now Python would be the scripting engine for Excel, the âdata browserâ.
So what happens when you're trying to work on your laptop and you don't have a reliable Internet connection?
Wait, didn't they already do this? I'm pretty sure I downloaded an official add-on for this a few years ago.
I work for a big bank. There is no way infosec guys would allow this, its no use to us. Even ChatGPT is blocked.
This is a nightmare. Python devs are going to be asked to support the half-baked python macros of business users.
very smart move!
clearly aimed at big business/enterprise customers, python's ecosystem of scientific & statistical libraries is massive
not so long ago they introduced Office Scripts and Power Automate, in essence coding macros in TypeScript (rather than VBA), again only for business/enterprise license users though.
Does this allow Microsoft to work around Apple app store restrictions on running interpreted code?
DIY:
-> excel cell: rest api call
-> send request to your own python web app: run python function. send back the output.
Bold prediction: this will have a greater economic impact than LLMs over the next 10 years.
Is this the end for internal javascript frontends?
Should I learn python for Excel instead of Django?
I wonder who'll be the first to ship python in a major browser
This would be a good moment to ask for good free Python courses.
Soon Python will rule it all as the most widely adopted language
What's wrong with openpyxl?
Heck the .xslx file format is fancy XML.
Nice, waiting for the new machine on HackTheBox :-D
Half joking: Now we know why Microsoft hired Guido.
HELL YEAH!
Why not starlark?
Cool a novel malware vector for the uninitiated
definitely_not_malware.xls.py
game changers for the competitive scene, looking forward to MAKRO's commentary
Now that Microsoft embraced Python, what are the odds it will go all the way to extend and extinguish it (or at least CPython as reference implementation)? There are much more excel users than programmers. If excel runs Python, it has the potential to become the "de facto" standard interpreter, used by most people worldwide, displacing CPython.
This was a nice surprise to see today as an Ex-Excel developer who worked on trying to bring Python to Excel (and, I guess, failing ;)).
7+ years ago I had the option of leaving the Excel team. My then bossâs boss knew I had an interest in bringing Python to Excel and offered me a chance to tackle it if I chose to stay. What was meant to be a 6 month project turned into a ~3 year project, the Python part faded away and we ended up enabling JavaScript Custom Functions in Excel instead.
For Python we were also running âin the cloudâ (AzureML v1), although there was some back-and-forth on if we should run locally. I think what made the Python part disappear was our partner AzureML team re-orged, re-released, re-hired, we lost a PM and our work caught the attention of another partner team who realised they could use our code to execute their JavaScript out-of-process. And so I spent a lot of time ensuring that feature was successfully shipped at, I guess, the detriment of Python.
I had a lot of help from some strong engineers and learnt a lot. The core of the work was modifying the calculation engine of Excel to allow functions to compute asynchronously, allowing the user to continue working on other parts of their spreadsheet while the remote endpoint (be it JavaScript, Python or something else) was computing. Previously the spreadsheet would lock up while calculations were running, and that wouldnât be cool for long-running unbounded calculations. Have to wonder if any of the stuff we built made it into this new feature.
Super great to see this and look forward to trying it out.
Recalc or die