Settings

Theme

Python in Excel – Available Now

techcommunity.microsoft.com

73 points by masteruvpuppetz a year ago · 34 comments

Reader

vanous a year ago

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

dijit a year ago

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

  • itishappy a year ago

    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...

  • stackskipton a year ago

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

benterix a year ago

See here for some insights:

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

curiousgal a year ago

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.

  • inemesitaffia a year ago

    They can offer it in an outpost cloud

    • curiousgal a year ago

      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.

qsort a year ago

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?

  • zamadatix a year ago

    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.

  • ryzvonusef a year ago

    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.

    • fzumstein a year ago

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

      • ryzvonusef a year ago

        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.)

yawnxyz a year ago

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

bubblesnort a year ago

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.

Mister_Snuggles a year ago

> 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.

karlschlosshax a year ago

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!

  • layer8 a year ago

    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.

    • Qem a year ago

      > 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.

CodeTheInternet a year ago

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

solarkraft a year ago

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

ok123456 a year ago

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.

pjmlp a year ago

> 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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection