The Python Editor for Excel is a welcome innovation of the Microsoft Garage project making editing and debugging Python code in Excel a lot easier.
Python Editor add-on for Excel mirrors the functionalities of renowned integrated development environments (IDEs) using the code management system behind Visual Studio Code.
Sample code from A new way to get UTC time into Excel
From syntax highlighting and IntelliSense to automatic code completion and clean formatting, Python Editor borrows essential elements from top-tier IDEs and puts them into the Excel side-pane.
Python Editor in Excel features
Its advanced debugging capabilities allow users to see the result of each coding step, ensuring precision. Right-click to see familiar options like Go to Definition/Symbol and Peek.
Ideal for scripting longer code sequences that don’t nicely fit into the formula bar.
See the current result at the bottom of the code as either an Excel result or Python object.
Edit Python code iteratively without affecting data unless you choose to commit the changes, ensuring data integrity.
Line Numbering! Useful when there’s an error on a specific line number (the formula bar doesn’t have line numbers).
Get Python Editor in Excel
If you’re eager to elevate your coding within Excel, the Python Editor is accessible via the Office Add-ins Store.
It’s part of a single Excel Labs add-on which includes the Advanced Formula Environment and LABS.GENERATIVEAI function.
If you’re unfamiliar with the Microsoft Garage, it’s a unique platform where Microsoft professionals from diverse teams collaborate to devise experimental software. These creations either evolve into standalone products or integrate into pre-existing Microsoft solutions.