September 16th, 2024

Python in Excel – Available Now

Microsoft has launched Python in Excel for Microsoft 365 Business and Enterprise users, enabling advanced analytics with popular libraries, a Copilot feature for code generation, and enhanced security measures.

Read original articleLink Icon
Python in Excel – Available Now

Microsoft has announced the general availability of Python in Excel for Windows users of Microsoft 365 Business and Enterprise. This integration, developed in partnership with Anaconda, allows users to combine Python's powerful analytics capabilities with Excel's flexibility without any setup. Users can now utilize popular Python libraries such as pandas, Matplotlib, and NLTK directly within Excel workbooks. The feature supports advanced analytics, including predictive modeling and data visualization, and simplifies complex data handling. Additionally, a new Copilot feature enables users to generate Python code using natural language prompts, enhancing accessibility for those unfamiliar with coding. Security measures ensure that Python code runs in isolated containers on the Microsoft Cloud, protecting user data. Python in Excel is available to users with qualifying Microsoft 365 subscriptions, with options for enhanced performance through an add-on license. Microsoft encourages user feedback to continue improving the feature.

- Python in Excel is now available for Microsoft 365 Business and Enterprise users on Windows.

- Users can leverage popular Python libraries for advanced analytics and data visualization.

- The new Copilot feature allows for natural language prompts to generate Python code.

- Security measures ensure data protection by running Python code in isolated containers.

- Feedback from users is encouraged to enhance the functionality of Python in Excel.

Link Icon 15 comments
By @vanous - 7 months
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

By @dijit - 7 months
Does this still run in Azure? I can’t imaging wanting to use such a system with that caveat.
By @benterix - 7 months
By @curiousgal - 7 months
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.
By @qsort - 7 months
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?
By @yawnxyz - 7 months
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

By @bubblesnort - 7 months
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.

By @Mister_Snuggles - 7 months
> 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.

By @karlschlosshax - 7 months
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!

By @CodeTheInternet - 7 months
What is the benefit of running Python in Excel vs using Pandas for example?
By @solarkraft - 7 months
It seems crazy to strongly link your spreadsheets to the cloud.
By @ok123456 - 7 months
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.
By @pjmlp - 7 months
> 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.