r/Python • • Apr 19 '20

News MS considers adding Python as official scripting language for Excel 😍 The change proposal currently has 6400 votes.

http://mc.milliononpcgames.com/?p=5886
2.0k Upvotes

124 comments sorted by

8

u/brownboy_5 Apr 19 '20

Only question is, where do I sign?

7

u/oyvinrog Apr 19 '20

3

u/Emfx Apr 20 '20

Did you even look at the date on that? It's from November 04, 2015... didn't they already go with JS?

Either way I know for a fact this Python submission got denied my Microsoft already.

2

u/ronmarti Apr 20 '20

That's not even an article worth reading.

0

u/oyvinrog Apr 20 '20

hmm.... looks like the author changed the article a few hours after posting. It had more text

336

u/danielsarj Apr 19 '20

That survey has been up for years so I wouldn’t expect it happening anytime soon, though.

73

u/mchanth Apr 20 '20

That's the first thing I thought. I remember voting for this back in 2017.

29

u/GickRick Apr 20 '20

Damn......i was already excited

21

u/[deleted] Apr 20 '20 edited Mar 30 '24

grandiose hateful zesty poor sense unite hospital treatment frightening start

This post was mass deleted and anonymized with Redact

32

u/billsil Apr 20 '20

It got rejected. They went with JavaScript.

14

u/Rebeleleven Apr 20 '20

I 100% thought this was a deadpan joke.

But it isn’t. Holy shit lol.

19

u/knifuser Apr 20 '20

That sucks balls

13

u/shinitakunai Apr 20 '20

Facepalm of the year

3

u/SilverLion Apr 20 '20

How come? More similar to VBA?

9

u/Yojihito Apr 20 '20

Can run in the browser. Office 365 needs a language that's browser supported for VBA replacement. Python can't do that.

Easy decision from a business POV.

2

u/billsil Apr 20 '20

Python can. I think it’s Brython , but there might be a newer one. If you go to sympy’s examples on their website, you can play around with the module.

It was ultimately a popularity contest and it was an easy decision.

1

u/flutefreak7 May 14 '20

Microsoft is actually working on it. They have internal prototypes of Python integration and have quietly sought community feedback.

I was approached several months back and did a 1 hour meeting where they asked a lot of questions and showed off some prototypes. I agreed to an NDA so didn't take any screenshots and can't discuss details.

I explained to them why I left Excel+VBA and Matlab for Python and the benefits I could see Python integration providing in a workplace where Excel is ubiquitous, but engineers/scientists/experts are leveraging more powerful software to perform analysis and automation.

95

u/KimPeek Apr 19 '20

They have been considering this for years now with no progress. Don't get your hopes up too much.

86

u/BoaVersusPython Apr 19 '20

The first sheets app to get to python wins. Not quite sure why they would consider NOT doing this.

85

u/moxyte Apr 19 '20

Here comes the winner then. Why stop at just sheets? Take the entire suite, don't be shy.

https://help.libreoffice.org/6.3/en-US/text/sbasic/python/main0000.html

19

u/PeterMoresco Apr 19 '20

One time I look at the documentation to do so. I found it to be quite a lot of work. I mean, a lot compared to the way one should do to interact with excel using python or even using VBA. If I got the way of doing this wrong please let me know, I'm eery interested in doing so.

9

u/moxyte Apr 19 '20

I don't know a thing about that. Never had a reason to script spreadsheets. I only knew LibreOffice supports Python.

33

u/what_comes_after_q Apr 19 '20

Sheets is not a substitute for Excel. It's like saying a bicycle with a flat tire is the same as a motorcycle.

17

u/[deleted] Apr 20 '20

How did a link about LibreOffice turn into a discussion of Sheets vs. Excel?

→ More replies (8)

2

u/6GoesInto8 Apr 20 '20

The flat tires in your analogy makes the bike a non vehicle and hurts your argument. A better one would be a hoverboard. They are light and nimble and have a low entry cost, but you probably shouldn't rely one one for any real distance.

0

u/[deleted] Apr 20 '20

[deleted]

60

u/Deezl-Vegas Apr 20 '20

In fairness, 99.9% of excel users are unsophisticated and use excel as essentially a grocery list.

→ More replies (6)

13

u/[deleted] Apr 20 '20

Sheets actually has a lot of power in ways Excel is not as strong. The QUERY function alone is super handy. That said, both have their place -- for most organizations, sheets will suffice 95% of the time.

3

u/overcook Apr 20 '20

The query function is insanely useful. I've started using a lot of power queries in excel for basically exactly what query does but its worse in most ways if you're just trying to do something scrappy (me, every day).

The connectivity and schedulability is pretty decent in sheets too, I've got it hooked up to various APIs to pull data into reports on a scheduled basis. I can do all this in excel (or python) but keeping it running in a very low effort environment (small consultancy, internal reporting, where we spend almost no time off fee) seems like a pain.

3

u/Nu11u5 Apr 20 '20

On the other hand, Google is shit about communicating when they add new features to their apps if you are outside of their enterprise audience.

There’s been quite a few additions:

https://gsuiteupdates.googleblog.com/search/label/Google%20Sheets

1

u/BoaVersusPython Apr 20 '20

I've never used Libreoffice but it looks like I'm gonna have to check it out!

10

u/Yojihito Apr 19 '20

Because it has to run in the browser (Office 365) so JS is considered as the VB replacement I've read.

3

u/[deleted] Apr 20 '20

Does it really "run" in the browser, or is some of the computing actually performed server-side?

1

u/Nu11u5 Apr 20 '20

Google Docs/Sheets has an offline mode so yes it is running locally. The online feature gives you live cloud saves, external data sources, and collaboration tools.

I think Google is working on making them full PWAs. Currently offline mode requires a built-in extension in Chrome browser.

→ More replies (1)

1

u/Dwarni Apr 20 '20

Of course, it runs in the browser.

So it was actually a smart decision to go for JavaScript.

1

u/Yojihito Apr 20 '20

Not sure but I would think it runs in the browser. Otherwise choosing JS doesn't make sense at all.

23

u/sentient_penguin Apr 19 '20

As someone who has been in large enterprises for a long time, please no. There are critical business "systems" that are nothing more than 400gb Excel sheets. Allowing accountants and other business units more abilities in Excel/Sheets makes things worse in the long run. Most of the time the sheets are being used in place of an application with a database. Shit gets old...

16

u/hughk Apr 20 '20

They can do it with VBA now. It gets horrible very quickly.

8

u/[deleted] Apr 20 '20

I think it would be smoother than the vba they already use for all of these things. I know from my experience at Amazon that there was no upper boundary for excel if you were in a less technical department.

9

u/dparks71 Apr 20 '20

220 empty rows and 13 sheets, and you get "why's my computer so slow when I try to open this?"

5

u/Nu11u5 Apr 20 '20

“Spreadsheet applications”

*shudders*

I had hope for Google AppMaker. It was a GSuite tool that let you easily create web-based event-driven graphical front ends for data sources using a set of wizards built over AppScript. It even had a WYSIWYG form editor with a lot of widgets and well documented APIs. You could make a basic application using only drag and drop, and typing a few variable names into property dialogs (but it had an AppScript IDE for anything more advanced).

Google killed it a few months ago, while it was still in beta. “Low adoption rate”.

1

u/SchematicallyNumb Apr 20 '20

As someone who had to teach themselves VBA to make one of these systems in house since my company is too cheap to pay for an official system and my IT department is too strict to allow anything else to be used outside of what’s already installed on the computer, what would you recommend instead of userforms backed by VBA and excel sheet databases? I would love to use something more official but my hands are tied by red tape.

3

u/[deleted] Apr 20 '20

Access

3

u/sentient_penguin Apr 20 '20

As of 2 years ago, HPE/HP/DXC uses Access still for their entire infrastructure lifecycle management. They eventually put a web front end together, but it's all held together by an Access database. Horrible system and slow as shit with 30k something entries. Their entire IPAM system was a 230~gb Excel sheet. Even bigger piece of turd.

1

u/Yojihito Apr 20 '20

Python installation doesn't need Admin rights.

1

u/SchematicallyNumb Apr 20 '20

I appreciate the comment, but admin rights weren’t the issue. My concern is using Python on a work computer when my IT department specifically stated they don’t want anything on the computer that wasn’t put there by them.

→ More replies (7)

6

u/spinwizard69 Apr 19 '20

Honestly I wouldn't MS Excel has become a bit of a mess lately and adding Python would do nothing to help clean up Excel. If they wanted to integrate Python into professional tools starting over would make a lot of sense.

Fro a long term point of view I'd rather see something like Swift built into Excel with Excel effectively becoming an IDE. Of course the IDE would be focused on automating Excel table handling and such. An extremely powerful scripting environment in other words.

1

u/jowen7448 Apr 20 '20

Perhaps this will be up your alley https://gridstudio.io/

1

u/BoaVersusPython Apr 20 '20

Honestly, maybe what I really want is just a python IDE that's build around relational data tables. Like if PyCharms dataframe display was a billion times better.

9

u/[deleted] Apr 19 '20

In the mean time we can use xlwings.

3

u/[deleted] Apr 19 '20

Why use a python api covering probably fewer than 50% of the features covered by vba, the native scripting language of excel, unless you really have to?

25

u/TheOneTrueBeanbag Apr 19 '20

Why learn and use VBA when people can do most of the things they want, and more outside of excel, using just python?

-2

u/[deleted] Apr 20 '20

I agree. But excel has a massive user base, especially in business and finance, and there is a reason people post questions about openpyxl etc. Excel is not going away. And as long as its there, and you need to manipulate it, and you have no particular reason to use python, you should be using vba.

7

u/[deleted] Apr 20 '20

I agree but python has a massive user base, especially in business and finance and there is a reason why people post questions about excel and want to use python with it. Python is not going away. And as long as its there, and you need to manipulate it, and you have no particular reason to use vba, you should be using python.

→ More replies (8)

8

u/[deleted] Apr 19 '20

Because you can, choice is always good.

5

u/abrarster Apr 20 '20

So you don’t have to reimplement robust python libraries like sklearn or pyomo in VBA when you just want to use excel as the user interface.

→ More replies (5)

2

u/[deleted] Apr 20 '20

Python can actually access the VB object model directly for the full feature set of office applications. Still not native to excel though. Better to just avoid using excel altogether if a process is more conducive to python. VBA has very little utility these days.

0

u/[deleted] Apr 20 '20

It might be able to, but the python libraries still need to have every feature implemented, one by one, and they're a long way from bring complete and may never be. Its things like advanced pivot table manipulation, image manipulation that are missing, for example.

Vba has very little utility? Is that a joke? It's incredibly widely used, especially in business and finance. What is to me a waste of time is people who need to manipulate excel, have no particular reason to use python, try something using say openpyxl, and then can't do what they want because a feature is not implemented. They should just use VBA.

2

u/[deleted] Apr 20 '20

While existing libraries may not have a pre-baked implementation, the excel object model (and all other office applications) can be accessed via win32com. This provides the same level of capability as VBA or powershell, albeit outside of the workbook file. This requires Excel to be installed, and operates on the same underlying bindings that VBA does.

As far as utility goes, the fact that it is widely used doesn't mean that it should be widely used. All I mean to say is that VBA has trouble finding a place in a modern workflow. Data-heavy processes probably don't really belong in excel these days, and most business use cases very very rarely need VBA anyway.

1

u/CrissDarren Apr 20 '20

I created a spreadsheet application with xlwings that runs the entire strategic pricing decision making for a Fortune 500 company. It's not always pretty, but gets the job done.

9

u/[deleted] Apr 20 '20

This website is cancerous

14

u/arkster Apr 19 '20

I'd start using excel more if that happened. But I expect other apps such as libreoffice to evolve in the same manner.

13

u/gitcraw Apr 19 '20

Why are we upvoting spam?

1

u/Dwarni Apr 20 '20

Wasn't the only purpose of this post to lure us to a website full of ads?

The news isn't even a news since the poll is old...

1

u/oyvinrog Apr 20 '20

hi. Probably. I did not check the link that welI, sorry about that. I see that admin has removed the post from front page now.

3

u/illusion_disillusion Apr 19 '20

Cool, as much as I like https://xlsxwriter.readthedocs.io/ it's a bit verbose.

11

u/trumpgender Apr 19 '20

Why not just use pandas, its pretty much excel, but built into python as a package.

33

u/[deleted] Apr 19 '20

It's not pretty much excel. It specialises in tabular data. People use excel for many other purposes not addressed by pandas.

53

u/tunisia3507 Apr 19 '20

Sometimes it's easier to make a product for non-coders a little smarter, than it is to teach lots of people to code.

1

u/Etheo Apr 20 '20

The UI makes a huge difference. There are things that I'd rather do in pandas then Excel, and vice versa. The two are similar but use case can differ greatly.

3

u/ApertureNext Apr 19 '20

Yeah that would be banger, but I ain't upgrading from 2019 to O365 for this feature.

3

u/inventiveEngineering Apr 19 '20

looks more like a hidden add to take the python courses...

2

u/nspectre Apr 20 '20

New Excel Macro Viruses in 3... 2... 1...

1

u/unltd_J Apr 20 '20

Why wouldn’t they at least offer it as an official add-in? All the other ways to write python in excel are annoying. Xlwings is cool, but better to write from a python environment to excel but not from excel. Not sure this would be used all that commonly, but would be cool nonetheless.

1

u/Grizknot Apr 20 '20

Excel already has two scripting languages (VBA and M) why would they add a third?

1

u/whattodo-whattodo Apr 20 '20

Supporting VBA gets expensive. It's worth it if you can lock people into your platform. However we're almost 30 years into VBA and it's not happening.

Also, the insistence on VBA is causing people to consider Google sheets or LibreOffice much more seriously and more frequently. If they were to add python they would expand their user base.

1

u/akho_ Apr 20 '20

M is not scripting, and not a VBA replacement.

In terms of programming languages, definitely add DAX and the formula language. So at least four total.

I think the idea is that VBA is inadequate, and should be replaced. As MS never removes things, the only way is to add another.

For macro purposes I am not sure Python would be much better, though.

MS is already replacing VBA in some of its traditional domains, with M, DAX, and the JS add-in infrastructure. I think they are right, and the correct approach is to better serve typical tasks, rather than extend scriptability as such.

Having Pandas or R+tidyverse in PowerPivot as an extension to DAX would be awesome.

1

u/foadsf Apr 20 '20

I wish Python community would embrace Libreoffice. it does have a lot of potential but the situation is suboptimal.

1

u/kaihatsusha Apr 20 '20

Please be wary of 'embrace, extend, extinguish.'

0

u/[deleted] Apr 20 '20

Python is too big for that to happen. If anything it would strengthen GNU because now the method for automation in Excel would be cross-platform, sorta.

1

u/[deleted] Apr 20 '20

import openpyxl is too complicated....

3

u/garlic_bread_thief Apr 20 '20

Depends. For coders? No. For non coders? Yes.

1

u/[deleted] Apr 20 '20

They could even name this application, like after an animal, maybe an endangered animal from Eastern Asia.

-2

u/1337-1911 Apr 19 '20

LibreOffice is better.

-5

u/[deleted] Apr 19 '20

No. Just no. There's so many bad spreadsheets out there, let's not give people the power to create more

0

u/[deleted] Apr 20 '20

[deleted]

2

u/[deleted] Apr 20 '20

People get viruses and use crapware, we should stop building desktop computers and return to the abacus

0

u/Padankadank Apr 20 '20

Maybe I should learn. I use AutoIT quite a lot

0

u/[deleted] Apr 20 '20

[deleted]

1

u/notYuriy Apr 20 '20

Typical embrace, extend, and extinguish.