Python as an Excel scripting language
Let us do scripting with Python! Yay! Not only as an alternative to VBA, but also as an alternative to field functions (=SUM(A1:A2))
Thank you for the continued interest in this space. While we don’t have specific plans to announce at this time, we have been researching the topic, conducting customer interviews, and are working with the Python team at Microsoft so we can build a plan that we think can address the scenarios you told us about and ensure it can run wherever Excel runs.
Keyur [Microsoft Excel]
Steven C commented
Using xlOil, which is free - see https://xloil.readthedocs.io/en/latest/ and one of the python COM libraries like win32com python can do everything that VBA can do. Plus some things it can't, like async and concurrent functions and jupyter connections.
xlOil runs primarily via the C API with python in-process so has very lower overhead.
(disclaimer: I wrote it, please let me know if you encounter any issues and I'll look at them straightaway)
monkey do commented
I'm okay if you just have a official excel library in python even if it's not inside the Excel environment.
Brian Janiszewski commented
@Admin, This post is over 2+ years old. There's have been many other 3rd part work arounds implemented since then. Stop jerking our chain and either cancel it or approve it and get it implemented FFS. VBA is a S*** language for the common user.
My hope is on Guido Van Rossum who joind MS
The story of VBA is a special one. Someone should write a book about it.
Even though the lack of progress regarding VBA felt painful for me personally, it made me move on to python and I'm thankful for that. Actually I think the path chosen by Microsoft is brilliant. Imagine a world in which python replaced VBA 15 years ago. That would have meant new categories of problems we don't even have names for yet. A whole range of applications would not have had a reason to move away from excel. As a result possibly tarnished reputations for both excel and python. But we missed a lot of fun coding as well, that is also true.
steven sheng commented
As a top ranked programming language for AI, the enabling python as scripting language would greatly enhance data processing capability of excel.
Will this be moving forward now that Guido has joined Microsoft?
Agreed it needs to be added as a facility by Microsoft not a third party at extra cost to be useful so work can be shared.
Michael Critchley commented
What you fail to mention Tony Roberts is that you have to pay a $25/mth subscription to Pyxll to implement the solution you suggest. Excel users shouldn't have to pay extra to code using a modern programming language. Microsoft has the resources to replicate and surpass the functionality that this 3rd party software provides and yet, for whatever reason (an explanation would be nice), chooses to retain a legacy IDE for an outdated programming language.
Tony Roberts commented
If you want to use a Jupyter Notebook from within Excel for scripting like you can with the VBA editor see this https://youtu.be/Od-1cEac9U4. You can script Excel with this and Python, as well as writing user defined functions, RTD, macros, menus etc.
Tony Roberts commented
Python can already be used as a scripting language in Excel. Here's a video that shows how it's possible to write Excel functions entirely in Python: https://youtu.be/vyDd_3r93cU
Melisa Barýþ commented
This exceeded my expectations and is better than anything else I have used. I would definitely recommend it for such service
Get in touch with spydetections on
What Microsoft is doing is letting people know that if you need more advanced resources you better go to something different rather than excel
Muhammad Raza Cheema commented
I work in the Manufacturing Industry and when we can't find a calculation in commercial software we turn to Excel and make a spreadsheet. One of the main reason I don't like Excel is how limited the VBA is regarding data integration. I learned Python to look for other solutions and I love Python now. It has everything for me and now I can create calculation spreadsheets without even thinking about excel.
No one asking to remove VBA support as a lot of businesses rely on it. Just add python support along with VBA and give users a choice. ANSYS has done it by using IronPython project.
Nick Hemsing commented
For those that are defending VBA, this isn't about VBA or replacing VBA with Python. Too many business and finance users are deep into VBA and I think Microsoft is well aware of the necessity of VBA to those users.
However, Excel is also used for sciences, including data science. It is also used by business users like me that use Python to manipulate large data sets. Having Python (or R) as another scripting language for Excel allows those users to integrate their algorithms with the features of Excel. Excel can, for those users, then take advantage of an expansive list of packages for gathering and manipulating data to then present in or prepare for further review, in their spreadsheets.
Adriaan Riet commented
@Joe Bockover I really don't think you need to fully understand interpreters or third party modules to use python, any more than most business professionals understand the DOM. Also, python isn't a one-trick pony, so you can't pretend it "belongs" in one environment. I'm still hoping (maybe) one day to get this feature, so I disagree with those leaving "forever" that we've All Moved on, though. I found python far easier to learn than VBA, but maybe that was from the good documentation and decent IDE.
jay zh commented
@Jamie Totally agree with you. Those chose to ignore programming can still use Excel just fine, maybe with limited functionalities. However, for serious Excel users, programming is inevitable. For example, my work involves with lots of data and computations. Without a programming language's help I will be 1000 times slower and potentially not able to carry out any work. I chose to use Python to work with Excel because it's just so much better than VBA in all aspects.
Joe Bockover commented
Dear python folks who want to say goodbye: Goodbye. You won't be missed. And Excel/VBA will live on just fine without you, considering so many business processes are deeply rooted and dependent on it.