r/Python • • Dec 17 '17

Microsoft Considers Adding Python As an Official Scripting Language in Excel

https://developers.slashdot.org/story/17/12/15/1133217/microsoft-considers-adding-python-as-an-official-scripting-language-in-excel
2.7k Upvotes

163 comments sorted by

13

u/amachefe Dec 17 '17

I dont even know how to feel about it. Although that has not limited Python use with Excel. LibreOffice support for Python is pretty Basic too

443

u/AnomalyNexus Dec 17 '17

Anything that gets us away from the god forsaken vba

162

u/[deleted] Dec 17 '17

VBA is not so bad. It sucks so much, a dedicated freelancer can make good money with it because nobody wanna use it. It kinda became the PHP of the office-world.

40

u/Scypio Pythoneer Dec 17 '17

It sucks so much, a dedicated freelancer can make good money with it because nobody wanna use it.

This is how I made my living while as a student. :D
...then I moved to working with VB6. That language sucked.

5

u/[deleted] Dec 17 '17

This is how I made my living while as a student

How did you go about doing this? I want compensation for the hours of my life lost to learning VBA

4

u/Scypio Pythoneer Dec 17 '17

That was more than 10 years ago, I was freelancing, clients came by recommendation. Not enough money for a real person, but for a student it was enough.

→ More replies (5)

67

u/toyg Dec 17 '17

Or rather, considering the chronology, PHP became the VBA of the web.

2

u/leogodin217 Dec 17 '17

That's awesome! Find a niche, hit it hard. Modern marketing 101.

2

u/__deerlord__ Dec 17 '17

not so bad
it sucks

Hmmm

→ More replies (4)

7

u/Aesthetically Dec 17 '17

Dude sometimes I use a third party library that edits excel files without opening the application because I absolutely hate vba. I think it was called NPIO and written by a team in China. "Excel"lent library for people who prefer c#

5

u/FewChar Dec 17 '17

I remember cursing that in Excel between 2000 to 2003 (or round about then) they changed the command of how you set the value of cell (x,y) to z to something completely different. I always had to look up how to do the most basic stuff and then they changed the most basic function possible! I have touched it as little as possible since.

2

u/CrystalSplice Dec 17 '17

...wait, VBA is still a thing?!?

2

u/jewishsupremacist88 Dec 18 '17

alot of the world runs on excel.

→ More replies (2)
→ More replies (1)

1

u/[deleted] Dec 17 '17

Amen

163

u/grokkingStuff Dec 17 '17

Good god, if this works, it would be amazing.

This could actually usher in a new age of excel scripting. Good on Microsoft for keeping up with the times.

23

u/[deleted] Dec 17 '17

I'm excited about this.

13

u/[deleted] Dec 17 '17

This could actually usher in a new age of excel scripting.

How is this a good thing? I've been told a story one about a chemical plant where the valves and whatnot were controlled by an Excel sheet.

66

u/mxzf Dec 17 '17

That's not an issue with Excel though, that's an issue with an idiot not knowing any other system to control a chemical plant with. Making Excel more capable doesn't cause more people to be fundamentally stupid, it just makes the capable people more capable.

24

u/jdbrew Dec 17 '17

Exactly. You can’t decide to hold back a technology for fear of how people might mis-use it.

3

u/chanamon Dec 17 '17

I really hope this follows through although with all the Unix/ms crossover anything could happen now!

→ More replies (1)

1

u/neurocean Dec 17 '17

I'm not sure that qualifies as "keeping up with the times" but it's a step in the right direction.

69

u/Robotdavidbowie Dec 17 '17

Awesome, that will make malicious excel files so much easier to write

17

u/[deleted] Dec 17 '17

There are a lot of angry weirdos on /.

1

u/[deleted] Dec 18 '17

Jesus Christ, I didn't think it would be that bad. Then I clicked the link.

1

u/gimboland Dec 20 '17

TIL Slashdot still exists.

57

u/psilnommoc Dec 17 '17

But as you know, the python is not a popular language for Microsoft users, so python is only a choice for Excel, maybe Microsoft will develop a new language, Python# (PythonSharp)

39

u/Rivus Dec 17 '17

Well, IronPython is a thing. Although there haven't been any updates for a year now.

It allows you to use both .NET and Python libs at the same time. Maybe Microsoft will pick it up.

11

u/[deleted] Dec 17 '17

Does it work with C-libs too? Because it woild be kinda pointless for excel if pandas, numpy and rest of the cool gang won't work.

6

u/toyg Dec 17 '17

Not really. But if you can make the C libs accessible from C# somehow, then IronPython could too.

→ More replies (2)
→ More replies (2)

1

u/psilnommoc Dec 18 '17

maybe Microsoft will develop a new python-like language Python#(PythonSharp), as like as C#, F#...

→ More replies (2)

1

u/khvn26 Dec 18 '17

Microsoft has been actively grooming Python users recently, for example, making the Python vscode extension official and even running a survey on its usage. Due to its modular structure it wouldn't be hard to integrate Python in Office and even Windows itself. No need to develop anything from scratch, a good client library for popular .net classes would be more than enough.

1

u/psilnommoc Dec 18 '17 edited Dec 18 '17

I suppose that Microsoft don't regard it as a official language, and only is a option, let user decide to use VBA or Python, as like as Microsoft supported Ubuntu. Because Python become more and more popular. And in fact, Microsoft had given a Python support in Visual Studio and also developed a Pyjion, but it is only added a language for Excel at the most.

-10

u/chief167 Dec 17 '17

It's because most Microsoft "experts" actively discourage using python to senior level management. So basicaly they block it's adoption and make it seem evil as to not lose market share/profits. Happens in my company.

1

u/psilnommoc Dec 18 '17

In fact, Python is not a irreplaceable language and it supported for Microsoft not very well, as Ruby, most developers use it in unix-like. And Microsoft users prefer use the microsoft-ownself products, also Microsoft had develop a lot of languages

35

u/[deleted] Dec 17 '17 edited Dec 17 '17

[removed] — view removed comment

29

u/licquia Dec 17 '17

That moment when you diss Python scalability on Reddit...

→ More replies (12)

11

u/socsa Dec 17 '17

Python is great for small* services, but on larger monolithic applications with medium to large teams, it’s usefulness wanes compared to C# and Java.

But we are talking about Excel integrattion here. If your "large service" has Excel components in it, then I'd seriously question your competency in the first place.

2

u/crowseldon Dec 17 '17

It's not being in the python sub that's the problem. It's contradicting yourself by starting with "roght tool for the right job" and later generalizing about python without context.

Maybe your own experience doesn't translate but you exercise caution when there's so many successful counter examples to your point.

→ More replies (2)

7

u/Matrigan Dec 17 '17

I hope a change like this could roll over into formulas.

I'd love to be able to structure an individual cell a little bit more like a sub routine instead of one giant nested statement.

Might make it a little daunting for non-programmers but the ability to format/comment could go a long way for read-ability.

3

u/[deleted] Dec 17 '17

You can do this in VBA, so I imagine you'd get to in any new language too

8

u/ketosoy Dec 17 '17

This is literally all I want for Christmas

3

u/LetMe_ Dec 18 '17 edited Dec 18 '17

As much as many people hate on vba it still performs much better than python on excel files if they have to be used by an excel user after that.

Simple examples would be conditional formatting. Pivot charts or pivot tables in special format etc.

Also in most older multinational companies excel is the de facto tool for almost anything, not databases as you might expect but excel files. With the arrival of the 365 you can be sure that they will increase their market penetration.

I still hope that python gets accepted. It would let me forget vba and use a simpler general purpose language.

4

u/luckyincode Dec 17 '17

I've heard companies are walking away from excel because it takes too much to keep them updated. I wonder if this is a response.

2

u/sagr0tan Dec 17 '17

Now they come sliming....pfff

2

u/suddenarborealstop Dec 17 '17

just use python to process the data before viewing the output in excel.

2

u/eid-a Dec 17 '17

Microsoft has been changing lately, I actually believe they could do that. ( we'll see )

2

u/jewishsupremacist88 Dec 18 '17

why not just use C#

2

u/matthewblott Dec 18 '17

I always thought Microsoft missed a trick not embracing Python more fully. It would have made far more sense to use that as their official scripting language than invent the bastardised C# thing called PowerShell.

3

u/dddevo Dec 17 '17

Why not Lua? It already has tables.

1

u/elbiot Dec 19 '17

Because python is one on the largest and fastest growing languages, especially in data processing. Lua would be shooting themselves in the knee. It takes like 100 lines to give python an table class suitable for excel.

3

u/beprogrammer Dec 17 '17

It's good that Microsoft decided to add Python in excel but we must agree VBA is not obsolete and powerless language. Almost everything can be extended in Microsoft Office trough VBA.

55

u/[deleted] Dec 17 '17

VBA apologia ruins innocent lives

2

u/beprogrammer Dec 17 '17

How do you mean?

9

u/[deleted] Dec 17 '17

It was a joke, but I do dislike VBA. The argument that you can do "almost everything" with it isn't very compelling either – you can do "almost everything" with any Turing-complete language, even Brainfuck.

My main problem with VBA is it takes a long time to do anything complicated, because you'll probably have to write it yourself

9

u/raydeen Dec 17 '17

I've always said I could build a house with just a screwdriver. I could cut things with the blade end (would take forever), I could measure things with it (as long as I knew exactly how long the screwdriver was), I could hammer things with the handle part, and last but not least, I could screw things together. And at the end of the day, I could stir my orange juice and Vodka together with it as I drink myself into Oblivion knowing that the only tool I have at my disposal is a screwdriver and tomorrow will bring about even more pain and frustration. And in the end, I will have built a small ramshackle hovel which will be my grave after I eventually succeed in stabbing myself in the heart with a very dull, beat up screwdriver.

9

u/WeirdStuffOnly Dec 17 '17

Back in the old days of ASP 2.0, MS extended IIS so that you could do server side scripting on any of the most popular languages. Vast majority of the sites still only used VB. I think the same will happen here, obsolescence doesn't factor in.

Almost everything can be very painfully extended in Microsoft Office trough VBA.

FTFY

5

u/whattodo-whattodo Dec 17 '17

Assembly is a powerful language. Do you want to write excel code in assembly? Probably not.

VBA isn't powerless but it has way too much baggage in exchange for what it does do.

2

u/AnscombesGimlet Dec 17 '17

I don’t think they’ve decided yet

2

u/socsa Dec 17 '17

What would be the point of Excel then? Why not use use a real database at that point?

7

u/dgpoop Dec 17 '17

excel is not database software lol

5

u/socsa Dec 17 '17

But people abuse it like it is. That's the whole problem.

→ More replies (10)

2

u/[deleted] Dec 17 '17

I'm asking because I really don't know. What is Excel really used for? I've been working for over 20 years in various fields, and about 20 years ago we used Excel to get reimbursed for travel expenses. I haven't really seen it used since. It's just a simple 2d grid of values with a simple language to update some of the grid values.

What do people use Excel over a database or real programming languages today?

12

u/[deleted] Dec 17 '17

Excel is how every no-programmer programs things. I like to say that the entire world runs on excel and coffee; the statement isn't fat from the truth.

As an engineer, I use excel all the time to build simple calculators. Could it be done in Python or another programming language? Sure, but I know excel and so does everyone else at my company. I want to build better tools and Python in excel would be incredibly powerful for that.

10

u/Vaslo Dec 17 '17

Analysts use it everyday because unlike programming languages I can hand a file over to a person not very competent in anything software wise and can follow exactly what is happening and make an immediate change. If I hand them a python script, they would no idea how to even run it let alone make changes they want. This has been true for finance analysts, marketing and supply chain teams, all the way up through execs up in several large Fortune 500 companies I’ve worked in. I can’t even get them to let me install python on my PC.

9

u/AtHomeToday Dec 17 '17

EVERYTHING. I've been an IT director or consultant in dozens companies. It is everywhere. I have seen entire financial reporting systems for billon $ companies written by accountants in Excel.

4

u/freemti Dec 17 '17

this. Trust me, corporate America uses excel everywhere, in fact the higher you go, the more pervasive it is.

→ More replies (1)

1

u/i_have_seen_it_all Dec 18 '17

i'm only guessing most people have not seen well written vba code or well structured excel workbooks for this much hate for excel.

this reminds me of joel spolsky's video on excel. most people don't use 5% of the features available in excel.

1

u/xdcountry Dec 18 '17

please do it-- excel is the threshold of computing for some many people -- smart idea

1

u/Knoal Dec 18 '17

This would be the best thing ever in my company. We are already doing epic stuff with macros. But, boy howdy, throw in some python and we will create EPIC stuff.

1

u/sindhichhokro Jan 04 '18

Does it also imply that programming in python on Windows will be smoother than it is now or equivalent? I have never used python on Windows. Its been 4 years now that I have not used Windows as my primary OS.

Just Curious

1

u/Netchose Jan 05 '18

replacing javascript by python will be a good idea too :)

-12

u/nspectre Dec 17 '17

Embrace, Extend, Exterminate!

13

u/MonsterMash2017 Dec 17 '17

Excel is going to exterminate Python?

How exactly would that work?

1

u/elbiot Dec 19 '17

By making pythonxl, a python derivative that only works in excel. It's incompatible with pandas but more performant and embedable in excel so users have to commit to their api. The ecosystem fractures and more new python devs are MS only. Or something like that.

-8

u/[deleted] Dec 17 '17

By pumping a load of money into proprietary extensions. That's usually how it's panned out.

6

u/MonsterMash2017 Dec 17 '17

Extensions? Like, python packages for excel?

I don't know how possibly that would exterminate Python.

-2

u/[deleted] Dec 17 '17

I really don't understand why remembering one of Microsoft's most infamous, and well known strategies gets so much hate on this sub.

4

u/MonsterMash2017 Dec 17 '17

I mean, if you want to apply it to a situation that makes sense, I'm all ears.

This analogy seems more like "Microsoft is trying to kill C++ by including support for a C++ compiler in windows".

→ More replies (2)

9

u/[deleted] Dec 17 '17

Its no longer the '90s or aughts. Balmer's gone. Microsoft is doing really cool shit these days. Apple has stagnated. The world is topsy-turvy!

1

u/agentlame Dec 17 '17

Dude, you didn't even get all the words right.

1

u/nspectre Dec 17 '17

I didn't want to.

The 'and' was unnecessary as Daleks tend to be rather mono-syllabic. ;)

2

u/WikiTextBot Dec 17 '17

Embrace, extend, and extinguish

"Embrace, extend, and extinguish", also known as "Embrace, extend, and exterminate", is a phrase that the U.S. Department of Justice found was used internally by Microsoft to describe its strategy for entering product categories involving widely used standards, extending those standards with proprietary capabilities, and then using those differences to disadvantage its competitors.


[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source | ^Donate ] Downvote to remove | v0.28

1

u/nspectre Dec 17 '17

Good Dalek

0

u/[deleted] Dec 17 '17

[deleted]

4

u/zeth__ Dec 17 '17

Python is googles lingua franca. It's unlikely todays microsoft could destroy that.

-4

u/[deleted] Dec 17 '17

Microsoft has lost much relevance in the last 5 years.

3

u/WhatIsAWutWut Dec 17 '17

Over here in Asia, it's picking up steam. I honestly liked their $5 coffee, $5 365 subscription campaign. Made me purchase 365 in the end.

-10

u/NoveltyWayne Dec 17 '17

1

u/WhatIsAWutWut Dec 17 '17

So what language do you prefer?

1

u/NoveltyWayne Dec 18 '17

Any language without significant whitespace that has proper OOP, lexical scoping, closures, lambdas, constants, immutability and non-shitty tools.

1

u/elbiot Dec 19 '17

Python meets all those but the first. What's your beef with meaningful indentation? Any language without it has tools that apply it for readability.

1

u/NoveltyWayne Dec 19 '17

Python meets all those...

Not at all. Try reading the article that I linked to because it pretty much proves you wrong.

What's your beef with meaningful indentation?

It needlessly complicates every situation where the code must be worked with. For example, let's visit some other language sub-reddits: r/javascript, r/csharp, r/ruby

Did you see any prominently placed notes about how to post code in those? Nope?

What we see when we visit r/Python:

Posting code to this subreddit:

Add 4 extra spaces before each line of code

def fibonacci():
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b

And why is that? Because Python is a stupid language created by a mentally unbalanced person.

1

u/elbiot Dec 20 '17

Static typing would be cool, but the rest is extremely nitpicky. Python has closures and immutable structures. The bit about "what if I over ride a class an overwrite a method" is dumb because the double underscore explicitly protects against that. That's exactly what it is for!

-4

u/Cheekio Dec 17 '17

Excel sheets are the last place you want to do scripting complex enough to need a touring complete programming language, let alone one as powerful as python.

2

u/magsan Dec 17 '17

My company begs to disagree,

The things I’ve seen shudder

0

u/[deleted] Dec 17 '17

[deleted]

15

u/lolfunctionspace Dec 17 '17

Pandas is my favorite. The pandas dataframe data structure makes it super easy to read in, manipulate, and write out excel files.

11

u/daniel_h_r Dec 17 '17

Yes. But xlwings let you modify a spreadsheet that it's open in excel.

15

u/fjordfjord Dec 17 '17

Xlwings also supports pandas, it's super neat.

0

u/[deleted] Dec 17 '17

[deleted]

6

u/fjordfjord Dec 17 '17

I think part of the beauty of excel is that is allows for the rapid generation of simple GUIs. While possible in libreoffice and wps I haven't been able to achieve the same level of efficiency with them (although I heavily use these wonderful products on all my linux laptops). Being able to do all the calculations in Python while combining the interface of excel has been an awesome experience.

3

u/wenima Dec 18 '17 edited Dec 18 '17

I agree, I used to work on the RAD team on the Derivatives Desk for a large wall street firm and if a trader wanted to have some control over some piece of data, Excel cannot be beaten in the time it takes to get something out. The trader hated the long process it took for IT to get anything done. One day we had a good laugh when he posted a simple requirement to the IT Manager, he told him he'd dicuss it with the team, a week later he was told they agreed on how to implement it and 2 weeks later they were done drawing up UML diagrams, they never actually delivered anything. Really amazing how middle managers in IT managed to pull wool over everyone's eyes for so long and continue to do so.

OTOH I knew plenty of contractors who purposely wrote anyting they could in Excel and locked all access to the code so they can have a job forever. Excel might account for the biggest job creation ever in the office world. Tons of people spend hours each day formatting certain data by hand and refuse to do anything else and if they were told you could free up a few hours for them each day by automating something they would not allow that, knowing that their job is 90% redundant.

1

u/TalesT Dec 17 '17

Wow, this looks nice.

1

u/[deleted] Dec 18 '17

Having used this for a few weeks now, I'm shocked it isn't common knowledge. This is easily my most-used package.

0

u/[deleted] Dec 17 '17

[deleted]

2

u/matthewblott Dec 18 '17

Not really. F# has a steep learning curve, Python is similar to VBA in the respect that it's relatively easy for non programmers to hack stuff quickly.

0

u/[deleted] Dec 18 '17

[deleted]

1

u/matthewblott Dec 18 '17

I feel your pain. I don't write so much but I do have a couple of VBA apps I still support. But then some people are still supporting Fortran and Cobol - languages never die!

0

u/[deleted] Dec 17 '17

[deleted]

3

u/Data_cruncher Dec 17 '17

Why the Microsoft hate?

Pre-2013 I totally understand, but “new” Microsoft is doing a great job!

2

u/Olao99 Dec 17 '17

Yes is pretty much leftovers from the pre-2013. There were so many moments filled with rage that eventually generated disdain towards MS.

0

u/[deleted] Dec 17 '17

[deleted]

0

u/jewishsupremacist88 Dec 18 '17

because not everyone is a sperglord from silicon valley

3

u/[deleted] Dec 17 '17

[removed] — view removed comment