24 ms·
Excel team considering Python as scripting language: asking for feedback
Folks, Microsoft is officially considering providing Python support in Excel (finally). If you are interested in this, please visit their uservoice page and let them know what you think. Thank you!
https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/10549005-python-as-an-excel-scripting-language
- datpuz 9y agoThis would be awesome! I've built some tools using VBA and found it to be the most painfully unpleasant programming language I've ever used. Python is by contrast the most pleasant!
- smortaz 9y agoClickable Link: https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/10549005-python-as-an-excel-scripting-language https://excel.uservoice.com/forums/304921-excel-for-windows-... [disclaimer+bias: on Python team @ msft & would love to see this happen!]
- odonnellryan 9y agoSo what's the strategy here re: security? I assume it'd be a fairly stripped-down version of Python ... or will you just design the UI to say "you probably shouldn't execute files from people you don't know" etc?
- smortaz 9y agoChallenges exist & will have to be looked at for sure. Incidentally, one of the guys on our team just a gave talk on his PEP for "Secure" Python: https://www.python.org/dev/peps/pep-0551/ https://www.python.org/dev/peps/pep-0551/ There's a YT talk as well.
- davb 9y agoI’d rather full fat Python but heavily sandboxed with some form of firewall. “Do you want to allow 2018_Stock_Report_Q1.xlsp to connect to api.erp.corp.mycompany.com?”. Codesigning with my something under my corp CA, manage permissions via Group Policy and let users, on a per-endpoint or per-permission basis, authorise things like filesystem access, network connections, etc.
- esmi 9y agoFrom a security point of view how is embedding python different from embedding Visual Basic? This is not my area of expertise so I’m genuinely curious.
- Groxx 9y agoPotentially different. .NET allows signed binaries / libs / a fully signed execution context, Python has nothing equivalent AFAIK.
- Nullabillity 9y ago> @ msft Well, I guess that explains why you care about Office in 2017.
- canadianwriter 9y agoThat and the fact that the vast majority of companies use Office...
- cm2187 9y agoWhich is also why it is surprising that Microsoft has spent so little time on office in 20 years. Outside of changing the colors regularly, there has been very few new significant functionalities between Office 2003 and Office 2016. And opening the VBA IDE is a nasty reminder. I'd argue large companies are still running Windows because of Office. The cost of retraining people, redesigning all of these user processes and converting all those documents would be massive. Whereas most new corporate applications in the last 5 years have been mostly web based. So I am surprised Microsoft under-invest in what is they main strategic lock-in in the juicy enterprise market.
- taspeotis 9y agoBetween 2003 and 2016 they took some massive desktop applications and put versions of them on the web and mobile...
- bluedino 9y agoIf you think about it, only 20% if employees can use office at a medium to high level anyways - a lot less people to retrain. The rest are "I click this button then do this thing"
- toyg 9y ago> very few new significant functionalities between Office 2003 and Office 2016 The first release to feature the Ribbon, arguably one of the all-time major changes in Office, was 2007. That took quite a bit for most users to get used to. An Office suite is not where you add experimental features for the hell of it. People use it to get the job done in so many different scenarios, any change will significantly impact entire industries. Office programs are the "lawyers" and "accountants" of the software world: their work has been more or less the same since they existed, and any major change to them is a basically societal upheaval, so their approach will always be naturally conservative.
- bdowling 9y agoSo, would this imply numpy and scipy support in Python for Excel? How about support for Excel worksheets within Jupyter notebooks?
- smortaz 9y agoThat's for the Excel team to decide. My personal hope is that they'll offer as a base: * Python 3 * Numpy, SciPy, Pandas, Matplotlib, Altair, ... * Pythonic bindings for Excel APIs (sheets, etc etc) * VSCode's Python Editor + Debugger built in * Some sort of conda based env/pkg mgmt * Right-click, "Open in Jupyter" (data/code) * <your wish here>
- vvanders 9y agoYeah, matplotlib, scipy and numpy are kinda no-brainers there.
- breatheoften 9y agoPlease not matplotlib ... are we really stuck with matplotlib forever ..?
- vvanders 9y agoIf you've got better suggestions I'm all ears. I've found it pretty great for debugging and being able to understand data in a rapid manner.
- disgruntledphd2 9y agoggplot2. Simply better in every way. Hell, even base R is better than matplotlib. Full disclosure: I hate matplotlib so very, very much.
- auxym 9y agoTransparent access to Excel tables as Pandas Dataframes would be so, so very awesome. I mean, MS implemented these really nice Tables in excel, but then left us no way to easily query them with something like SQL.
- askvictor 9y agoInterestingly, the survey doesn't seem to consider education as a use-case of this - has your team considered that aspect? Spreadsheets are the most common way that school students are introduced to programming, and the only 'programming' that a lot of teachers (and others) do. There are heaps of reasons for this, but any even moderate programming (beyond very simple operations) in a spreadsheet sucks. Something like this (if it's easy out of the box) could revolutionise programming education (and data education for that matter). Are there plans to get this working with the Excel web-app, or just the desktop version? I'm just having a daydream about Excel, Juypter notebooks, and OneNote Class notebooks...
- rmbeard 9y agoI think we will see and are already seeing a move away from using spreadsheets in Education, there are simply much better solutions out there now. Jupyter notebooks being one which allow reading and writing to Excel files. The interface of these is far superior for educational purposes than a spreadsheet. I've already dropped Excel for this reason.
- smortaz 9y agoThat's a very good point! I hope you provided that input :). Our team provides a free service for anyone to run Jupyter Notebooks on Azure. It's currently a big hit with the Edu crowd. We're seeing lots & lots of universities upload & teach courses on it. eg: http://notebooks.azure.com/richie http://notebooks.azure.com/richie There's also an Intro to Python notebook on the front page. Hopefully the Excel team will consider Jupyter integration, esp for the web-app version! You're right that it's a killer combo. Check out xlwing's video on using Excel+Jupyter - it's brilliant.
- _e 9y agoDear Excel team, Take a look at the top three results for "excel python" on bing.com for some great ideas on how to incorporate python into excel. --- 1.) https://www.python-excel.org https://www.python-excel.org 2.) https://www.pyxll.com/ https://www.pyxll.com/ 3.) https://www.xlwings.org/ https://www.xlwings.org/
- smortaz 9y agoThank you - all awesome tools. Kudos to the devs behind these bridges. We did one ourselves, but better ones have come along since then: https://www.youtube.com/watch?v=Gu31s7kXPOg https://www.youtube.com/watch?v=Gu31s7kXPOg
- askvictor 9y agoThere is also pyspread as a full spreadsheet implementation using and for Python: https://manns.github.io/pyspread/ https://manns.github.io/pyspread/
- vanderZwan 9y ago> Pyspread expects Python expressions in its grid cells, which makes a spreadsheet specific language obsolete. Each cell returns a Python object that can be accessed from other cells. These objects can represent anything including lists or matrices. Huh, on the one hand sounds like a such a simple way to deal with it that I can have trouble imagining a more elegant approach. On the other hand, does it still respect the ways that Excel updates cells? Sicne that kind of requires immutability I think.
- cheapsteak 9y ago> https://www.python-excel.org/ https://www.python-excel.org/ The https link doesn't seem to work, try this: http://www.python-excel.org/ http://www.python-excel.org/
- throwaway7645 9y agoAlso DataNitro
- 9y ago
- mschwaig 9y agoSo when I google how to do something in Python I will have to comb through solutions specific to v2, v3 and now also Excel? ;) Aside from that it sounds like a cool idea.
- deleted 9y ago[deleted]
- HumanDrivenDev 9y agoAn absolute no-brainer. Python is the new BASIC - very popular with people who have to program to do their work but aren't programmers. It's an excellent choice for a spreadsheet.
- blhack 9y ago>aren't programmers Also extremely popular with people who are programmers and need to do things. Sorry, this is a frustration of mine lately. Python is a fantastic introductory language. It's also a fantastic general purpose language. Newbies get turned off of it because it feels too easy, and they know that "real" programming is supposed to be hard.
- gregschlom 9y agoI disagree. Python is great for scripting and for small projects, but I believe strong, static typing is an essential feature for large scale projects. I wouldn't want to use Python for anything that's predicted to end up with more than a couple thousand lines of code.
- pdpi 9y agoPython 3 supports optional type annotations that you can check with something like flake8.
- frgtpsswrdlame 9y agoMost people writing VBA code for excel are only informal programmers. For example, I never took a CS course in my life but learned VBA and programming on the job. Since then I've learned python and other languages but when I'm doing a home project or something I always come back to python. It's just so easy. I was working on a macro the other day in Excel, it took me a couple hours to get it all working but I'm pretty confident that if I could've coded in python I could've banged it out in 20 minutes or less. Edit: I suppose my point got a little lost. What I mean is that I highly doubt much Excel code is a "big project." It may feel that way when you crawl through some of the hideous VBA coding I've done but much of this is due to the inexperience of the coder and the realities of VBA. Give me python + 4 or 5 libraries and I could recode anything I've ever made in VBA in 1000 lines or less.
- jonbarker 9y agoYou can already do this with xlrd and xlwt.
- civilian 9y agoExcel spreadsheets are cool because if you update data somewhere, it'll update all the formulas and products elsewhere. How do you get that kind of "watch" behavior with `xlrd` and `xlwt`? You don't, you have to re-run a script. Sucks.
- supbitcoin 9y agoplease do that
- AckSyn 9y agoThey're really dropping the ball by not using powershell
- DonnyV 9y agoDon't do it!
- jimnotgym 9y agoImagine all of those simple tasks that you could do in seconds with a python script. Export to csv in UTF-8 with double quoted fields. Loop through cells for row in rows: do some cool stuff Pull data from a REST API using requests rather than some VBA hack. I'm getting over excited already. Edit data for your ERP and then post it back to the API and update the db... This is exactly what finance/data people want. Write custom functions (with numpy maths!)! No more nested If's. This will keep Excel as the premium spreadsheet app. I love it
- discreditable 9y agoI already find myself reaching for Google Sheets quite frequently just to do this. I'd love to be able to use Python instead of JavaScript.
- ninjamayo 9y agoJust do it! We 've been waiting for decades for a replacement of visual basic.
- agumonkey 9y agopython isn't the bestest thing in the world but it's still a massive win for them, and a massive win for excel users. VBA had too many shortcomings and led to loads of scalability problems even for medium size apps.
- logicallee 9y agohere's my feedback: embed sqlite in it and you're done. Nobody needs any more servers, you can literally replace a hundred thousand dollar "big data" center and team of PhD data scientists with a business school dropout. And you will get prettier, more actionable results.
- willhslade 9y agoCan everyone read this and vote this up in the survey? This is the real LPT.
- nusq 9y agoYes please.
- muxator 9y agoI am 90% certain that MS has abandoned its EEE strategy from the nineties. But the scars from that era are so vivid in my mind, that I feel the need of a confirmation.
- abraae 9y agoWhat do you want confirmation of? That MS is now a gentle, caring beast? Large organizations are not like that, they are money making machines that adopt strategies to maximise profit. EEE is no longer such a strategy, though it worked very well for a long time. Will MS ever go EEE again? In a heartbeat if they felt it would maximise profits. Does that seem likely in the short to medium term? No, the industry is different now, and they have to play nice.
- frik 9y agoLook at "R" programming language, or look at "JavaScript" (-> TypeScript). They still do the EEE strategy. Fool me once...
- deleted 9y ago[deleted]
- tenryuu 9y agoI've probably mentioned this before on another news article. Not like it really matters. Python is nice as a beginner scripting language since it's (to my own judgement) the most easily readable language to its function set. When working with software like office, you are going to have a lot of users that don't exactly spend their days programming, or studying syntax. Excel is a little different in their own regard. The functions system has a lot of depth to it, and makes sense to a cell system, but for some it can be a but overwhelming in terms of how its written, since everything has to be written exactly as a function. I guess you also have generic office macros, haven't used them since high school. In saying that, could this somehow be a reason why the office team have decided on a python interpreter, instead of say JavaScript or Microsoft's work on Typescript. Because python is easy to write, fast to learn, therefore users or even really employees in large data management positions don't have to worry about their time input?
- pessimizer 9y agoAs long as the range object works in the same way, I don't care. Would be nice to have proper objects instead of having to use interfaces. It would also make a nice sandbox for beginners to learn python.
- dragonwriter 9y agoI'm actually more concerned with good tools for working with code than the language, but Python would be an improvement over VBA, and conceptually allow them to use Python tooling they've developed for other uses in Office.
- cm2187 9y agoMight be worth reminding everyone of a dead Microsoft project called VSTA, which was basically a live .net IDE embedded in Office. Effectively a mini visual studio inside any office application, where you can write any .net language. This would have allowed people to script in VB.net, C# or F#. Microsoft killed the project before it shipped (but licensed VSTA as a scripting tool for third party apps for a while). It's a pitty. I think this would have been a better solution than python.
- smortaz 9y agoGood point that the tooling would've been awesome. However, I don't think .net would have spawned the rich ecosystem of Python pkgs that we enjoy today. And /that/ is a huge part of the whole Python value prop. From astronomy to finance to bioinformatics to ML & everything in between, there's a pkg for that. We even did sponsored a port of numpy+scipy to .Net (via Anaconda). At the end of the day, there were just too many corner cases & too many pkgs to port for it to make sense.
- andygreenwell 9y agoGlad to hear that the Excel team is finally listening to your requests on this one. It's been a long time coming. Too bad they weren't interested during the TC days. If it does happen, it would be great if you could get the Cloud Numerics effort rebooted as well. There might still be a few people from our old team at NERD capable of resurrecting it.
- DoubleCribble 9y agoI know it's heretical amongst the Finance types... but one of the few reasons to use Sheets over Excel is for its scripting abilities. This will remove that advantage.
- kevin_thibedeau 9y agoAlt+F11... Script away.
- ropeladder 9y agoThis would be great but it's a bit surprising given the move to add support for R in SQL server, Power BI, etc...
- scottmcdot 9y agoYes I agree.
- timothylaurent 9y agoThis will be >>> better than using JS as a scripting language in Google Sheets.
- valuearb 9y agoThey should never do this because many people spent lots of time learning existing Excel scripting and they won't like it. Fortunately the user feedback will likely be very negative, so will stop this is it's tracks./s Henry Ford: "If I asked customers what they wanted, they would have said faster horses" Steve Jobs: "A lot of times, people don't know what they want until you show it to them" Seriously. Just build it and and make it great. When you can show that you can do amazing things with it, release it. The downvoters will also then adopt it, if you made it great.
- mosselman 9y agoRuby is a lot more non-programmer friendly and has an easier syntax if you ask me
- borplk 9y ago"NO! I prefer VBA to Python!" Said no one ever :)
- kgwgk 9y agoThousands of people would say it if MS attempted to remove VBA telling people to use python instead.
- sixothree 9y agoNo love for C#? Imagine the power of LINQ in Excel.
- flukus 9y agoC# has become way to complicated for this kind of use case. In terms of feature bloat it's looking a lot like c++.
- wenc 9y agoThis already exists. https://www.querystorm.com/ https://www.querystorm.com/
- icos 9y agoFor C# and LINQ in Excel there is my ESharper add-in https://vlasovstudio.com/esharper/ https://vlasovstudio.com/esharper/
- malmsteen 9y agoWell python is pretty much already well established but it should be wary of te famous "Embrace Extend Extinguish".
- Jacek1959 9y agoWhy not C# ?
- taspeotis 9y agoPython is used a lot for number crunching/data science. It has an ecosystem for that. Excel has the numbers. People want the two together!
- johnthomas00 9y agoDoes not M$ have a track record of getting everyone on board and then murdering everything in site. I mean it sounds good, but I don't trust M$. Maybe they have changed, but I'm not yet convinced.
- quickthrower2 9y agoEmbrace and extend python? I think not.
- craigyk 9y agoI'd vote for Lua: faster and less heavy than Python... Plus my biggest concern for Python would be how well the team can sandbox it. I know in this regard Lua also has advantages. Disclaimer: I am _way_ more proficient in Python than Lua, I just think Lua is a better choice.
- jimnotgym 9y agoDoes Lua have anything like Numpy or Scikit-learn?
- dsnuh 9y agoI was thinking the same. Would Excel be able to embed it like so many other projects do?
- alexeldeib 9y agoI've recently been using Lua, and I love it. That said, I find python a far more appropriate language. Think about the use cases and the ecosystem around python.The quality, breadth, and depth of the Lua ecosystem for the finance/education/data users of excel will lead users to favor Python. The main thing that might be nice is tables as a data structure for spreadsheets, but somehow I picture pain.
- Yuioup 9y agoAs well as agreeing to this, I would add the following: * I would support both Python 2 and Python 3. Yes I know that the push to Python 3 is ongoing but there are a lot more libraries to be found for 2. Don't bother with IronPython. * I would integrate pip or whatever package manager Python uses these days so that people can download their own modules and use them in the Excel sheets. Not only that, the packages should be restored automatically when the Excel sheet is loaded. * It goes without saying that Python should be sandboxed. * VS Code integration in Excel with full syntax highlighting and autocomplete - again a no-brainer.
- rspeer 9y ago> I would support both Python 2 and Python 3. Nah. They can spare a lot of pain and confusion by not having two different Pythons with different sets of libraries in Excel, and they have this opportunity because they don't have to support people's old Python 2 spreadsheets. There aren't old Python 2 spreadsheets. The libraries that are stuck on Python 2 really don't seem relevant here. There aren't many of them anymore [1], and I don't think people will be trying to run graphite-web or some busted old OpenID provider in their spreadsheet. (I originally used Fabric and Twisted as examples in the above, but hey, those are on Python 3 now. Also not things you'd be likely to use in a spreadsheet.) [1] http://py3readiness.org/ http://py3readiness.org/
- mark-r 9y agoHow do you sandbox Python when pip can install any arbitrary package?
- gh02t 9y agoMost of the big data science libraries are sunsetting support by 2020, so I don't think supporting Python 2 is a great idea. It used to be true that there were lots of libs stuck on Python 2, but I'm struggling to think of any major ones that'd be relevant to Excel that haven't moved forwards nowadays. No way it'd be worth the confusion of having two different versions of Python and the documentation headache that'd be. There's a case to be made for keeping Python 2 around for stuff like internal software, but you're not gonna be running that in Excel. http://www.python3statement.org/ http://www.python3statement.org/ <- look at the list of projects dropping support... NumPy, MPL, Pandas, SymPy etc.
- cm2187 9y agoWhat is interesting is also the implications of them now considering python. First if it is python, it is not javascript, which seemed to have been their previous favorite candidate until now (not sure if it really picked up). Second, the writing on the wall for VB as a language starts to look like a time square billboard. They basically put VB.net in maintenance / compatibility mode like webforms and winforms. I think it is clear that a new scripting language would be meant to ultimately replace VBA (which has been on maintenance / compatibility mode for 20 years!).
- contextfree 9y agoexcel already supports javascript for custom functions, add-ins, etc
- probinso 9y agoshould probably be prolog or apl instead
- pruthvishetty 9y agoYes, please.
- euske 9y agoIt would be great for a scripting language, but for field functions I would have preferred something that's more akin to FRP-oriented language (e.g. Scheme).
- vanderZwan 9y agoExcel itself is functional and reactive already, wouldn't adding an FRP language on top of that be a bit superfluous? Check out Felienne Hermans' work if you haven't already: https://www.youtube.com/watch?v=0yKf8TrLUOw https://www.youtube.com/watch?v=0yKf8TrLUOw http://www.felienne.com/publications http://www.felienne.com/publications
- euske 9y agoExcel is reactive already, but its field functions can't have variable bindings or procedural operation as far as I know (unless, of course, you write your own separate VBA function). I sometimes want to write in a complex one-liner and thought lisp/scheme would be a great choice.
- vanderZwan 9y agoAh, fair enough. I mean, I'm not debating the power of Lisp, and it would be great first languages for someone not trained in programming. OTOH, there is of course the trade-off to make it as useful for as broad a selection of users as possible; Python has a lot more mind-share, and the SciPy ecosystem would be a great complement. If Excel adds some practical convenience functions to the global namespace, would it be that hard to make Python fit the reactive paradigm in this context? About those variables: maybe the Bumblebee tool she and her team made[0][1][2] would work for you Our language is an extension of regular Excel formulas, so you can write a transformation like A1+A2 <-> SUM(A1:A2) which allows BumbleBee to transform exactly the formula A1+A2 to SUM(A1:A2) or vice versa. In addition to using exact cell references, you may also use variables instead of cell references: {i,j} + {i,j+1} <-> SUM({i,j}:{i,j+1}) I hope it can be useful to you! :) In the video I linked before she mentions it at 31m33s. Oh and here[3] are the slides for that video, in case you prefer those. (Disclaimer: I don't use Excel myself; I'm just a programmer who wants to get more people into programming, so I was both happy and impressed when I saw her presentation on how people not trained as programmers use it to do really complex tasks) [0] http://www.felienne.com/BumbleBee http://www.felienne.com/BumbleBee [1] http://www.felienne.com/archives/2964 http://www.felienne.com/archives/2964 [2] https://figshare.com/articles/BumbleBee_A_Transformation_Environment_for_Spreadsheet_Formulas/813347 https://figshare.com/articles/BumbleBee_A_Transformation_Env... Paper on BumbleBee [3] http://gotocon.com/dl/goto-amsterdam-2016/slides/FelienneHermans_PureFunctionalProgrammingInExcel.pdf http://gotocon.com/dl/goto-amsterdam-2016/slides/FelienneHer...
- barrystaes 9y agoI hope they wont localise the function names like they do for cell formulas. Never have i met someone who enjoyed this.
- froindt 9y agoI do quite a bit of VBA, but not much other programming. Could you clarify what you mean by localized? Just that the cell formulas cannot be (elegantly) accessed from VBA?
- edanni 9y agoThe formula names are translated into different languages so if you are used to using Excel in your native language you can't easily use it in English or vice versa.
- zwieback 9y agoMy biggest issue hasn't been VBA but the poor documentation of the Excel (Office) object model and the weird way of accessing cells and cell ranges. Would this get better in Python? I hope so.
- kevin_thibedeau 9y agoWhy not make it work with Windows Script Host for any compatible language?
- cessor 9y agoI use PANDAS in Jupyter Notebooks a lot. Sometimes, exploring large data frames can get tedious and I find myself loading up excel to explore and browse around, usually when deciding how to normalize or clean things up. Using Excel as a PANDAS Gui this way would be really great, but also using Python to script excel would be useful. And I guess I would love to call bokeh / seaborn after making an excel cell selection. I am looking forward to what a Python & Excel marriage will look like.
- cies 9y agoI thought there was a project for typed Excel. Any news on that one?
- olympus 9y agoVBA's one saving grace is that it's been available on every company computer I've ever used. Alt+F11 and I have an IDE. It's probably responsible for getting a few people involved in programming. But it had some serious limitations and some unexpected behavior compared to "real" programming languages. I hope that adding Python to Excel can be my new "guaranteed to be there" language on coworker's computers and get even more people involved in programming.
- shubb 9y agoIs anyone using javascript to write excel macros? That functionality has been out but a while right? Do people use it? What do they use it for? What makes them step back and reach for pandas or salesforce instead? For me, working across multiple excel files sucks right now. Excels handling of datatypes kind of sucks. And pretty spreadsheets that people like looking at and working with have a bunch of annotation in them so you end up extracting the sub tables you need anyway - why not into csv/dataframes. Tableu makes a lot of this better. Why not copy them instead of giving us another language to cheer about then ignore. Why not integrate power bi more tightly with Excel and ship it in the basic version of office, then let us script in there?
- chrisaycock 9y agoDoes Excel have a "plugin framework" for new languages the way Jupyter does? Ideally any language (Python/Julia/R/whatever) can be added by a third party without Microsoft's direct involvement. The plugin authors would only need to map a language or library's DataFrame mechanics to Excel's table layout. (Microsoft could even use Apache Arrow to represent the data.) I imagine there would be lots of possibilities by providing "hooks" for language designers to connect to.
- cm2187 9y agoYou can pretty much already do what you want with VSTO or XLLs. However having a standard scripting language installed on everyone's machine is a all different thing. It means you can add some scripted logic in your spreadsheet, give it to someone else, and know it will run without having to install or maintain anything.
- blendo 9y agoThis is incredibly important. When I worked at BigFinCorp, we always used vanilla Excel (VBA and ODBC to RDBMSs). So our sheets would always "just work". Python would be great in this role, but to avoid separate configuration, you'd need to ship the runtime with the spreadsheet, right? Or would this new Excel capability be built on .NET? In that case, C# (for the enterprise folks) and F# (for the bleeding edgers) would be fun, too. Bottom line, the Developer mode of Excel should support more than VBA.
- PaulHoule 9y agoIn the Microsoft world scripting is often mediated through COM: https://en.wikipedia.org/wiki/Component_Object_Model https://en.wikipedia.org/wiki/Component_Object_Model that is how people do stuff with VBA and Powershell and you can do it in Python with http://starship.python.net/crew/theller/comtypes/ http://starship.python.net/crew/theller/comtypes/
- TazeTSchnitzel 9y ago> Does Excel have a "plugin framework" for new languages the way Jupyter does? Ideally any language (Python/Julia/R/whatever) can be added by a third party without Microsoft's direct involvement. Could they use Microsoft's old Windows Script Host thing?
- erichurkman 9y agoI would love this, but for a unique use case: we generate _a lot_ of workbooks using Python. Some of them have hundreds of thousands of automatically generated formulas. We also have to write tests for workbooks. If we could embed Python, which all of our developers know, into Excel, it would make testing our formulas a bliss, rather than the burden it is today.
- gigatexal 9y agoDo it!!!!!! To stay relevant do it! I mean any language would be better than VBA.
- kazinator 9y agoAnything you think you can solve with Excel plus Python is much better done in just Python. This is like adding a tumor to Python. Operable, luckily.
- zoom6628 9y agoMuch as i would love for the power of Python in Excel it is important that whatever is done is consistent across the office experience. Some of us old enough to remember the multiple versions of VB-whatever across Excel, Word, Access and that in itself was a blow to productivity. Yes they should choose Python, and in the process decide if it will be Python with a .Net library (standard and core as seperate libs please!) or IronPython. This in itself is an important first choice. Then it has to be done in a mechanism that enables the exact same libs and user written python code to work in the same way across all the Office products. Other languages have been suggested, all good choices with their own merits. Lua is a good chocie for compactness and speed. C# is lingua franca of commercial developers so would suit ISVs but i think too heavy for end user scripting. Nim or even freepascal maybe? Lastly whatabout just using VB.net consistently? VB is a great language for newbs and casual/adhoc programmers .... but it gets ignored because of problems with consistency of implementation by MS. Last point i would like to make is IMHO the choice needs to be based on: - ability to transpile to javascript so that Excel365 can be scripted from webapps - install-free deployment; should be built into Excel in a way it can be used without any user install for dev or runtime - standard vanilla language, not a variant Disclaimer: A huge fan and long time user of python here. I also spent largest part of working life in ISV world rather than end user land.
- passwordqq2 9y agoVery well thought out answer and agree with the consistency part, don't target popularity, target consistency
- tkinz27 9y agoThe office 365 support could be implemented using the jupyter kernel protocols rather than transpiling to javascript. That would give them a consistent behavior across desktop and web and even open the door to support more languages in the future if they really wanted to.
- sametmax 9y agoThe reason Python is a popular choice is because it's a very polyvalent language (not specialized for any task but quite good at a lot of them) BUT the data analysis tookit in the Python ecosystem rocks (numpy, pandas, etc). Lua doesn't have a good data anaylisis story. C# is not made for scripting. VBA is not great outside of Office. Now given that cPython 3.6 has f-string, and that you probably will use string formatting a lot if you script a MS product, I would implement this version specifically. It's the most recent stable version of the standard implementation anyway. Actually no, I would not implement anything. I would embed the cPython 3.6 interpreter and stdlib, and just provide a binding to it. This limit the problem of bad / inconsistent implementations that crippled MS products in the past. Then I would say "we guaranty to provide a 3.6 compatible cPython + stdlib for the next x years" so that people can be confident to write Python stuff. Otherwise, a bad implementation would be worst than no implementation at all.
- wcr3 9y agotbh i think it's probs better to develop core apis (then maybe sdks) for interfacing w/ excel, et al rather than embedding languages (+ runtimes, libraries, envs/versions, etc.).
- gpw501 9y agoI'd like to see perl integration, that would be rad.
- harry8 9y agoPort it as a plug in to old versions of excel as first class citizens on release. There's been far too much, "here's a feature people will use so you're going to have to pay us yet again to open spreadsheets" in the history of excel. It's shit. It's awful. Don't do it. Using rich customers desires to extract money from those who neither need nor want the new feature is a crook's game. If microsoft aren't evil don't do it.
- tg2 9y agoSupporting R or Typescript/JavaScript would be great and probably closer to the Microsoft ethos (R is already very well supported in SQL server and PowerBI).
- Glench 9y agoI made a prototype programming environment that is more like a spreadsheet interface into Python called Flowsheets that y'all might be interested in: https://www.youtube.com/watch?v=y1Ca5czOY7Q https://www.youtube.com/watch?v=y1Ca5czOY7Q Flowsheets has become my preferred data manipulation environment.
- floki999 9y agoUnless the Excel team somehow integrates Python with the existing GUI design tool already found in Excel, it wouldn’t bring anything new to the table. There are already existing solutions such as DataNitro, which allow to code Python macros and functions and make use of Numpy, Pandas and Matplotlib. Microsoft is so far behind the curve it’s not funny. Their integration of either Python or IronPython in Visual Studio has been a mess for years. See Http://www.datanitro.com
- 75dvtwin 9y ago1) performance, including multi-sheet setups, should be better than the current Macros. For maintainability reasons, in one personal experience, I moved in-cell macros to VBA, and saw significant degradation in performance (my excel was calculating financial instrument attributes, based on raw input data (store in separate workbook with the same sheet)). So my ask would be that Python-based scripting would not just be the same as VBA in speed, but faster than in-cell macros. 2) There needs to be easy-to-use capability, to be able create XLS files with the new language macros, from within other programs. So that the new Python modules can be written out together with data from within other programming languages (and MS-supported libraries to replace or augment something like openpyxl, and similar libs for other langauages will be much welcomed) 3) I think Python as a choice for Excel is a good idea. It should be a language with 'duck typing', and that has support for Data Frames, Reactive programming. And in that light, I would like to see that Python's Pandas are first class citizens in being able to address Excel cells, participate in graphing, pivoting, etc. 4) Version control within the excel file... may be this is going beyond the original ask... but I think the spirit of introducing Python into excel, is around better SDLC/reusability. And so local and remote version control models should be supported. 5) I personally do not care if other MS Office tools (eg MS word) support Python. Would be nice.. but for my needs, this is not relevant. 6) a type-checking mode to be able to say, this Module will type check the data it uses... at run time.
- thkim 9y agopro: better compatibility with external libraries, syntax is nicer con: GUI programming will suck unless .net adds "visual python" I don't have statistics but I imagine people would prefer sticking to VB for ease of adding buttons, etc.
- jbergens 9y agoI think python is a bad choice for Excel, Ruby would probably be easier to people who are not developers and javascript might work just because if its reach (while still being simple).
- lawnchair_larry 9y agoI think basic Python is far easier for a newbie to learn than Ruby, and is commonly used as a scripting language for non-programmers.
- lafar6502 9y agoMaybe they read it here: Keep Excel application as is. Excel is OK without Python and VB seems ok, it's BASIC after all. Instead, concentrate on making Excel functions embeddable in server applications, this is area totally neglected so far. Think about server-side spreadsheet handling and calculations, that would allow Excel to drive business logic of systems. And maybe there Python would be useful, but i'd prefer just .Net runtime libraries instead.
- odonnellryan 9y agoThe best solution to this, in my experience, has been a data-backend for Excel. No, I'm not talking about connecting via ODBC. Rather, generating Excel documents from a data store: which may possibly be versioned and so on. Excel is not a good place to store data. It is good to work with data. It's really, really good to view data. People love it for that. But when you start to store a lot of data in Excel ...
- ww520 9y agoWhy not Typescript or some languages with stronger type support? Auto-complete is much more useful with a typed language.
- notsgnik 9y agoNative virtualenv and python inside windows would be great :p
- salmo 9y agoOK, I'll be honest. I usually avoid excel, except for excel to csv conversion. Then I write a python3 script starting with `import csv`. This would make the product actually useful for me. VB is terrible. I don't even want to think about it. JS is a language I put up with when I have to work in a browser. Python is a joy to use especially in situations like this. I can't tell you how many little apps I've had to write against CSV dumps from some stupid proprietary app without an API for Infosec or Capacity Planning or whatever that is essentially a report. I would do this instead in a heartbeat to avoid maintaining a service that gets used weekly/monthly/whatever.
- rmbeard 9y agoThere are now plenty of Python modules for working with Excel and Excel format files. Why are they trying to compete with those? As a university teacher I have dropped the use of Excel from my classes. I'm really not convinced this would convince me to go back. The philosophy of the product is just wrong. The should probably consider retiring Excel itself while maintaining support for Excel file formats. If they were to get behind some of the existing Python module initiatives or do something similar this would not be bad either, but using Excel as a front-end to Python is just a bad idea.
- thatcat 9y ago>Excel as a front-end to Python is just a bad idea I think a lot of people would like this because you can look at more data on your screen at once with excel compared to jupyter notebooks. What's the downside?
- rmbeard 9y agoThe downside is i) reproducibility. In the academic/research world there is a big move towards reproducible research, the nature of the Excel interface is not conducive to that. A standard scripting language is fine that plays with Excel but you don't want Excel necessarily as the main access point and the menu driven approach isn't conducive to keeping a permanent record of what buttons you click on. ii) In multi-cultural settings Excel defaults to the users system language, these days you simply jsut work with students laptops rather than using a standardized lab, so unlss you are polyglot working with Excel is just a really bad idea. Jupyter provides a standard interface and the default is always English, but supports multilingual content. iii) Python modules provide a huge range of solutions for many different domain applications, it's hard to see how Excel as an interface would provide support for every one of these modules. What I mean is how would Excel work as an I/O interface to a Python script that was doing something other than working with data? Notebook solutions already do this quite well.
- rmbeard 9y agoAlso for visualizing there are things like pandastable and DataExplore and other tools. You won't fix Excel by adding Python to it, but you do need the ability to process legacy xls and xlsx files so they need to at least continue that support.
- donatj 9y agoI hate to say it but why not ECMA Script (JS)? It’s everywhere and everyone knows enough to get by...
- pbreit 9y agoJavaScript is the obvious call. App Script for Google Docs/Sheets is very powerful and one of my favorite features: https://developers.google.com/apps-script/guides/sheets https://developers.google.com/apps-script/guides/sheets It makes for an excellent API runner. You massage a data set and then run it against an API very easily.
- pcvarmint 9y agoThis is a long time coming. There's a big backstory to it. Let me explain. "Exie" was the codename for Microsoft's attempt to create, in Excel, a language similar to MATLAB (and later, Julia). The name "Exie" meant that it would be integrated with Excel. It was based on Alan Edelman's Interactive Supercomputing (ISC), which Microsoft acquired in late 2009 [0]. ISC's main product was Star-P, an auto-parallelizing compiler in which users used a *p suffix in an array dimension to indicate parallelism across that dimension, similar to CoArray Fortran. Unfortunately, the ISC acquisition was a failure. Microsoft already had agreements with MathWorks and Cleve Moler (makers of MATLAB) which prohibited competitive software like Star-P. So Microsoft had to scramble and find other ways to get analytic, REPL, MATLAB-like software out the door. Unbeknownst to Microsoft, Julia was already making faster progress than they ever did, but on similar goals. Julia is what Microsoft had hoped Exie to become, and it's not a coincidence that Alan Edelman has been involved in Julia. Then, Steve Ballmer decided to abandon HPC and mathematical software, and to focus mostly on the cloud, which led to the very public dismissal of Bob Muglia. The head of Microsoft Technical Computing, Kyril Faenov, unfortunately committed suicide a year later. His wife, the daughter of a famous Seattle architect [1], did not respect his Jewish mother's wishes on the handling of his remains. His mother fought and lost in court [2]. Maybe Microsoft embracing Python in Excel is the best that can be hoped for now. It's certainly better than VB. But Exie tried, almost 10 years ago, to create an Excel environment closer to modern-day Julia than anything else. There were a lot of personal sacrifices in that effort. For example, Bill Blake, the former CEO of ISC, stayed at MS for a while during the transition, then moved to Cray as CTO for a while, and then died unexpectedly less than 4 months after he joined D-Wave. [3] [4] There's certainly been a lot of casualties, in the attempt to bring Excel up to being more analytically-friendly. Is it really worth it? [0] https://blogs.technet.microsoft.com/windowsserver/2009/09/21/microsoft-acquires-the-technology-assets-of-interactive-supercomputing-isc/ https://blogs.technet.microsoft.com/windowsserver/2009/09/21... [1] http://archive.seattleweekly.com/news/956673-129/seattleland-latest-selig-real-estate-fight http://archive.seattleweekly.com/news/956673-129/seattleland... [2] http://caselaw.findlaw.com/wa-court-of-appeals/1735359.html http://caselaw.findlaw.com/wa-court-of-appeals/1735359.html [3] https://www.cray.com/blog/cray-ceo-reflects-on-bill-blakes-legacy/ https://www.cray.com/blog/cray-ceo-reflects-on-bill-blakes-l... [4] https://www.dwavesys.com/blog/2015/04/bill-blake https://www.dwavesys.com/blog/2015/04/bill-blake
- rhelmer 9y agoThis post suddenly reminded me of Resolver Systems, who made a Python/.Net spreadsheet back in the '00s: http://www.prweb.com/releases/spreadsheet/competition/prweb1826304.htm http://www.prweb.com/releases/spreadsheet/competition/prweb1... I thought it was a good idea at the time, especially after having read "A Small Matter of Programming" which makes the case that spreadsheets are one of the very few successful end-user programming systems (the other being CAD): https://mitpress.mit.edu/books/small-matter-programming https://mitpress.mit.edu/books/small-matter-programming
- jgamman 9y agoAim for a front end notebook interface like Jupyter or Mathematica. Most excel i've had to play with was to store/manipulate data _and then_ C&P charts or data to word for the report. Seriously, notebooks.
- rmbeard 9y agoYou can basically use Jupyter as a frontend to Excel now anyway and never need to open Excel except to read and write to Excel files that you are sharing with Excel users.
- jgamman 9y agothat's cool - hadn't realised. i still dream about a word-excel mashup. imagine a table in word that when you click on it revolves around to reveal a spreadsheet and you hook the 'other side' to the calculation cells. literally separate data and text/analysis but packaged as a unit.
- princeb 9y agohonestly don't know how they are going to integrate python for me to think about how it could affect my workflow. it could be entirely possible that you could create both VB modules and Python modules in alt-f11 and functions and subs from either could be called from the spreadsheet. this would be great. if python had to be run in a separate app, not so great. will python in excel rely on the environment(s) installed independently in the system or the excel python environment? if the former, how to standardize runtime across different machines? support for the scipy libs and matplotlib would be nice. maybe matplotlib will generate plots in its own window - 6/10 if so. if matplotlib can generate plots as its own object within excel sheets - 7/10. if the plot is reactive to changes along its dependency chain - 9/10. if you can right-click format shape and adjust colors, lines, scales, axes - 10/10 support for python exception handling - well... ANY exception handling besides "ON" ERROR GO TO" / "RESUME NEXT" - 11/10 python with alt-f11's immediate and locals window + breakpoints + steps - 10/10. what about windows api? office interop? internally built xlls? guessing these will remain with VB and will remain compatible. guessing excel/office object models will also remain the same structure in python for excel. don't really care about output into jupyter. excel has "cells" too so you could technically output into a protected sheet if you wanted a read only report. we used to generate publications out of excel - chuck in some data into the sheets, matlab takes over the computation and spits it back into excel and a full report with cover sheet / table of contents / page numbers etc will be generated and we'd print and bind it professionally and send it back to the client. just a philosophical musing... excel is very "functional". from each cell/cse-array in your raw data to each cell/cse-array in final output there really ought to be a single chain of functions. i see a few comments here and on reddit where people are looking forward to happily blasting for loops on each cell in book-wide subroutines. that breaks the "functional"-like quality of excel. that makes excel a million times harder to audit. excel at its best should look a lot like f#.
- resoluteteeth 9y agoExcel already has VBA, C add-ins, COM interop, VSTO, javascript addins, and random functionality that's only available by using functions left over from Excel 5.0 macros (before VBA). These all have different weird limitations. What Excel absolutely does not need is for Microsoft to add another scripting language in a half-assed fashion and then get bored and stop again.
- eggy 9y agoI am all for more ways to hook into Excel since it is integral to many things I do for my job. There are some F# ways to play with Excel. I just wish MS would give more love to F#. [1] http://fsharp.org/guides/data-science/#excel-interop
- seak 9y agoAm already excited for this and would use it to the fullest. But i think Microsoft in doing this should come up with a way we can plug any other language(julia,lua,...). Getting this right now would mean a lot.
- kolombet 9y agoI would prefer JavaScript as scripting language. Or make support all clr compatible languages
- obilyk 9y agoF# should be best is Excel macros language. You may provide option to run Python from F#.
- johnmalc 9y agoyes please !
- serialhex 9y agoPlease God no! I'm all for a scripting language but the poor quality and inconsistencies of Python makes my life so much harder in the 5 other applications where it is the ONLY way to script everything. The fact that it is whitespace sensitive I have found makes it harder for beginners who try to edit pre-existing files that mix tabs and spaces. That's one dumb thing but there are many other thongs that bother me about Python. Yes to a scripting language, please no to Python.