Hacker News new | past | comments | ask | show | jobs | submit login
Python in Excel – Available Now (microsoft.com)
73 points by masteruvpuppetz 35 days ago | hide | past | favorite | 31 comments



It doesn't run locally, but rather uses Azure cloud.

For local python in a spreadsheet, LibrePythonista allows running IPython code in a LibreOffice spreadsheet

https://news.ycombinator.com/item?id=41443012


Does this still run in Azure? I can’t imaging wanting to use such a system with that caveat.


Yup, complete with free and paid tiers of service:

> The Python in Excel add-on license includes everything in Python in Excel for Microsoft 365, plus premium compute and more calculation mode options. Premium compute means faster Python formula calculation times. With the additional calculation mode options, you can switch between manual, partial, or automatic calculation modes to control when and how often your workbooks recalculate Python formulas.

https://support.microsoft.com/en-us/office/python-in-excel-a...


Yep, it still runs Server side (in Azure) and as such, requires 365 subscription.



They had a chance to charge banks and other financial institutions even more money by letting them run their own local python installations but they missed it.


They can offer it in an outpost cloud


Wouldn't be useful since most banks use python as a wrapper around their c++ quant libraries. They wouldn't want to ship that onto azure, even if it's private.


As someone who's not Excel-pilled, how does this work? Is it an alternative language to Excel's own formula language or an add-on like VBA?


It runs pretty much as described - you enter `=py` and it becomes a place to dump python code directly without configuring anything. The "catch" is it runs in the cloud and you need to buy the appropriate license level.


Possible to refer to other cells/sheets in that python code?


from what I understand from seeing youtube videos of it in action, you can use python functions libraries for the calculation part, but one of the strenghts of VBA was that you could interact with the Excel software itself, and that bit hasn't been replicated in python.

people liked they could set up scripts in VBA for automating routine tasks, but hated the VBA language syntax, from what I've understood, and wished they could program those functions in some more popular language like Python etc. But that isn't what this is.


It's exactly why I built xlwings, to replace VBA with Python. Python in Excel instead is a competitor to the Excel formula language.


Tools like xlwing are excellent, but people want to start excel first and stay in that interface.

If we are going to open up Jupyter notebooks, we have already failed.

(That's why VBA works, it's the only thing that runs on locked down corp laptops, because it's inside Excel.)


I've been stuffing JS and API calls into Google Sheets cells and for small use cases its great!

When you get very complicated flows, of one cell pointed to another cell, it becomes a massive mess. It's hard to debug and there's no way to "linearize" the flow into something more legible, and even harder to log everything. I hope Python in Excel figures out how to get over those hurdles


IIRC, Python had a win32 binding over 20 years ago and MS-Office 2000 onwards was scriptable via DCOM.

So with a little bit of effort this has already been a thing for 2 decades.

Not entirely sure how you move from plain win32 to DCOM, and it's probably a bit more difficult than WSH, but it should be doable.


> Python code used by Excel runs on the Microsoft Cloud with enterprise-level security as a compliant Microsoft 365 connected experience, just like OneDrive. The Python code runs in its own hypervisor isolated container using Azure Container Instances and secure, source-built packages from Anaconda through a secure software supply chain. Python in Excel keeps your data private by preventing the Python code from knowing who you are, and opening workbooks from the internet in further isolation within their own separate containers. Data from your workbooks can only be sent via the built-in xl() Python function, and the output of the Python code can only be returned as the result of the =PY() Excel function. The containers stay online as long as the workbook is open or until a timeout occurs. Your data does not persist in the Microsoft Cloud.

This is disappointing. A much easier way to 'keep your data private' would be to run it locally. Surely a bundled Python interpreter run inside a sandbox that prevents network access would be just as secure, and cheaper for Microsoft since they don't have to run any Azure resources to support it.


> just as secure

no way, itd be more secure...they wouldnt be able to peek into your spreadsheet


But would it have enterprise-level security?


I've wanted this for years. I think the best use cases are going to be really boring.

If you've ever written a spreadsheet of meaningful complexity, you've probably been forced into a disastrous mess of nested IF statements (or helper columns).

Python is soooo much easier to read than the built-in formulas.

I'm excited to try this out!


I expect this to become a compatibility nightmare in the long run, as new Python versions and library versions come and go. Also, this is cloud-only, which means your Excel documents won’t work standalone anymore. It’s a way for Microsoft to lock you in to their subscriptions.


> I expect this to become a compatibility nightmare in the long run, as new Python versions and library versions come and go.

I wonder if Microsoft may eventually EEE CPython by creating their own competing implementation running on top of Excel.


What is the benefit of running Python in Excel vs using Pandas for example?


It seems crazy to strongly link your spreadsheets to the cloud.


This is a mistake. Python tooling is a sandpit. Complicated Excel spreadsheets are another sandpit. Additionally, you can't evaluate your spreadsheet formulas if you don't have Azure access, and now you have to worry about the "cloud" permissions and storage.


> Python code used by Excel runs on the Microsoft Cloud ....

Nope, not only there is the security issue, regardless of what is promised, good luck editing those Excel files in flights, or train travels.


[flagged]


In general I'm very optimistic about the usefulness of AI to programmers but I can't think of much worse than an Excel sheet that's bundles a bunch of AI generated Python code from a quality assurance/correctness point of view!


I worked for a place a few years back that had stuff that was in C++/DCOM and written by someone snooting cocaine all day (both performance boosters) that the front end was an Excel spreadsheet. Now that was fragile.


I just can’t imagine what I can do here that I can’t do with a Python script using Pandas. Maybe visualization of data using Excel, in a way that makes it easier for boomers/accountants to understand?


basic interop like fetching data from s3 bucket, formatting it and showing as a table in excel would be a good use case, but not sure serverside python is needed for that.

more interesting idea could be using Excel as a jupyter-like front-end for the Python kernel. Imagine excel as a jupyter


Yeah, I think it's the compatibility with 'business language' for collaboration.

Most white-collar workers know how to use Excel to a really basic level of proficiency. Not many people know how to parse Python code.

It's also just a lot easier to work quickly in Excel. I dual boot Linux and Windows on my laptop so that I can have Windows keyboard shortcuts in Excel. If I need to do some lightweight financial modeling or analysis, it's dramatically faster (10x or more) for me to build a spreadsheet than write some Python/R code from scratch.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: