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 to all those participated in our survey. What an amazing number of responses, many of them with very deep content. We’re processing the over ten thousand responses(!), and already appreciate the time so many of you took to answer with passion and experience.
Please know this survey is used to help influence various topics – both on Python as well as other related topics that the comments started to bleed into. Given the passion, I want to be clear this remains an area of exploration for us, without any specific timeline.
We’ll provide updates as we progress on this feature request.
Lead Program Manager
Changes made to VBA reflecting changes made to excel itself. The language is frozen, but list of APIs always extending based on new functions in excel.
Programming in excel (or even FOR) is not the same thing as "real" programming. VBA is capable of almost anything (it was proven over all this years), you can even have pointers!
Moreover, if you going to build a massive app in excel - it's already bad idea and python won't help you there.
I forget to mention, that there's native C api via XLL libs. So the complete list of "languages" inside excel:
new macro recorder,
Adding python there won't give any benefits.
I think eventually MS will add java script as there's already environment prepared and excel for web is evolving where java script the only way to create add ins.
I have worked in many investment banks and I can tell that Excel is one of the key tool they have for lot of critical processes. Excel has many issues in automation - primarily because Microsoft never considered Excel as the strategic tool worth automation and assumed it to be used only by end users.
Excel (esp. Office 365) has a lot of potential to be part of mainstream software product development. For one, Excel is probably the best generic UI developed for any financial application, ever.
Well, VBA is dead to MS. There HAVE been small, small changes after the point they said it was done, would not be advanced further. (That, in itself, wasn't a bad thing as Excel is not chiefly used by programmers but rather by non-programmers so a set, unchanging VBA landscape had and has tremendous appeal to many.) But there is no growth, no new directions to accomodate more recent programming approaches, and no new or updated features. Nor will there be.It is NOT (ever going to be) "evolving."
For those great many though that DO want an evolving programming language, Python seems to fill the bill. For MS, the workload to accomodate it after the inital accomodation would be minimal and only necessary because the likely don't wish to expose that aspect of Excel... or Python developers would surely get right after doing that for them as well.
I acknowledge the current "others" but if I wanted to write code inside Excel that could reach out to a program I also wrote, or just use, that will do the real work hidden from users by being, well, a program, yet still be interactive at a very basic (ouch...) level with Excel so it can at the minimum be a front end if I like, well, something a lot like Python might be my choice. For many, many things.
It literally cannot hurt unless you don't have a grip on the important spreadsheets your organization owns. Which happens, yes, but so does money dropped on the ground and poor registration of organization passwords too. But you'd consider that bag of cash you have to be something that cannot hurt, eh?
Steven Stockton commented
VBA, and even almost every VBA tutorial I've seen + almost every bit of VBA sample code I've seen, _and_ all VBA code produced by the macro recorder promote Very Bad Things. Unsafe things. Slow things, like .select() and .selection(). Things that "just barely work, given the right circumstances", and sometimes things that only seem to work. Esoteric things, that have bizarre and sometimes undocumented side-effects.
VBA emits mostly-useless error messages. Like: "object-defined or user-defined error" when actually no error was defined, and the error arose outside of VBA code anyway.
VBA encourages use of MsgBox(), which is Horrible, in part because whenever this is called, the entire Excel interface (in every open workbook in the same instance of Excel) becomes unresponsive. But can still bring other workbooks to the front, just not interact with them, and Excel gives no indication why. The message box produced by this call doesn't show up in Alt-Tab or on the taskbar, either. A partial solution is Application.Assistant.DoAlert(), because then at least the message box will appear in front of any workbook that you try to interact with.
If you want to know how "easy" VBA is, read posts by Rubberduck on StackOverflow and on RubberduckVBA.
I don't know Python well, but for the many people who have learned it for some other purpose, it's easier than dealing with the many quirks and hidden traps of VBA. Projects which bolt Python to Excel like a sidecar include: PyXLL, OpenPyXL, Python for Excel (PFE), xlWings.
I, for one, welcome our new Python overlords, and would be in favour of building them a new house and IDE inside Excel.
I don’t think that implementing python is good idea.
VBA is pretty good and simple language for get things done (it’s even can utilize win32 api as well as any other dll!). Also success of VB6 and lately VBA has been related to how easily you can start developing, especially for non-developers (which majority of excel users are). Just hit ALT+F11 and you ready go.
Also it’s been there forever and changing very slow which is great because you can learn it once and further focus only on business task.
Yes, there’s some issues, but most of them can be fixed slowly evolving VBA.
For instance it would be great to refresh IDE, bring async.
It is very helpful to improve our work efficiently，because python is very simple and stronger，I hope Microsoft company can consider it as an Excel Scripting language
Mi job won't let me run Python on its own. They do let me run VBA, so they might allow Python inside Excel. This could be big for corporate use.
what is the update about this?
ige ielts commented
I can’t tell you how strongly I support this idea! Please make this a reality!
francisco contreras commented
I export the outputs of my python scripts to an excel file to share the data with no technical people (management) , would be great to have a built in python support as you already have in Power BI.
I dream to see Python as excel scripting language but please, keep VBA as well, do not remove it.
Its been like 4 years on this! Since then just look at the explotion of python as a go to language for Data Science and deeper analytics. No one is asking for a replacement to vba but moreso added functionality so that analyst can reduce the time it takes in changing over tools. Can you imagine if one was able to build prototypes in Excel using python then able to scale them up using pyspark or other tools? Well the answer is this is already happening its just wildly inefficient!
Most operational business instances can be solved using DAX but when applied and tied to bigger unstructured data instances I tend to vacate Excel for python and use some of its libraries to wrangle, transcribe, and communicate data findings. If I could do all of or sqy the 80 percent of effort spent wrangling data in Excel: holy smokes!!
Please re look at this thread and have a representative chime in to speak to any considerations being looked at.
Michael Magistro commented
Python is perhaps the fastest growing programming language topic on Stackoverflow. It's used for data science (a natural progression out of analysis in excel). Imagine how many people you'd attact to Excel if you had Python integration. Python is used for Jupyter Notebooks and Pandas (data science tools). This is all related. Integrating Python into Excel needs to happen!
I'm in a finance/investment environment setting where Excel VBA is de facto the universal language of all departments (of course Java, C# etc. as well in some other dep.) 20 year old vba's still do their job which is quite impressive.
I'm not sure whether a full integration of Python is necessary, although its a hype about it now. VBA Libraries that could use py classes etc. but also R, C#, F# or Julia (or simpler than XLL C++) other languages, would be fine,
Ahmad Abbasi commented
I really want a native programming environment for python embedded in Excel. I wanted to make a full fledged multi component distillation column in Excel, but having spent 1.5 months coding up functions in VBA I felt the need for making a class. But I found out that there is no constructor for instantiating an object. There were some clunky workarounds suggested online but looking at them I gave up on VBA to achieve the goal. Python would be way cooler with umpteen libraries and thriving ecosystem, which a 20 year old language like VBA does seem to lack.
James Ball commented
I'm in a business environment where we use Excel every day and that's the first tool businesspeople bust out to solve problems.
But none of our developers want to learn VBA. It's a career-limiting move.
Ethan Mace commented
So how many votes are necessary for integration?
OK. Truth be told, despite my voting to have Python scripting in Excel, I have since switched jobs, and while I use Python everyday, it's been years since I've opened Excel.
Emre Poyraz commented
I dont think Python should replace Excel functions. Excel functions are very mature and popular.
But how about having a Python based macro ability for excel? This could be an add-on. Python modules for Excel are not good enough to replace VBA.
Peter F commented
VBA is an ancient programming language, using it is no longer practical. IMHO if Microsoft wants to succeed, it needs to adopt to modern computing.