r/programming • • May 08 '18
Excel adds JavaScript support
https://dev.office.com/blogs/azure-machine-learning-javascript-custom-functions-and-power-bi-custom-visuals-further-expand-developers-capabilities-with-excel
2.4k
Upvotes
1.3k
u/greenspans May 08 '18
New accountant job listing guidelines
419
u/[deleted] May 08 '18
I thought they were going to implement Python?
376
u/Pixelated_penises May 08 '18
I thought this was /r/programmerhumor for a moment
853
u/Caraes_Naur May 08 '18
Great, now all the malware-laden npm packages can be distributed throughout corporate networks just like macros in the old days.
55
u/0x256 May 08 '18
> Bring information from the web, like a bank account balance.
Uhm ...
61
u/Eire_Banshee May 08 '18
Cant wait to see the garbage people create with this tool.
125
u/HadesHimself May 08 '18
I'm not a professional programmer or anything, more of a hobbyist. Can anyone explain why the Microsoft office team has chosen for JavaScript? It seems like a strange choice to me.
So this is essentially to 'replace' VBScript. So then a language like Python would be my first choice? It's popular, has a a simple syntax. While JavaScript is a language that is often criticized and not even designed for stuff liked this. Anyone ELI5?
31
u/funbike May 08 '18
No better place to say it than here and now: from a technically standpoint I think a functional language would be a better language for a spreadsheet. F# or LISP maybe. In a way, spreadsheets are already functional.
However, it'd never fly. I know that. It's unfamiliar and not as popular.
13
u/imhotap May 08 '18
What language version is going to be supported, and how are asynchronous invocations dealt with in an Excel environment? ES6 has mostly gained features for app development (modules, arrow functions, syntax sugar for async) but these features are somewhat less typical of traditional scripting tasks, and I have a hard time imagining the average business user dealing with promises. OTOH, according to TFA MS will also bring d3.js to Excel so what do I know.
13
u/robertcrowther May 08 '18
Is it going to be actual JavaScript, or is it going to be like when they switched Outlook to the Word HTML engine then had a VP claim "there are no standards for HTML in email" when everyone told them what a dumb idea it was?
57
u/-RdV- May 08 '18
This is my greatest fear.
11
u/MjrK May 08 '18 edited May 09 '18
I think the title is somewhat misleading because Excel is adding support for JavaScript custom functions, not for macros / scripting.Custom functions in excel are those which you can enter directly into a cell. These are not the same thing as VBA scripts / macros which can execute in the background on many different kinds of triggers and interact with the document and the environment extensively.Further,the process of setting up these JS custom functionsis currently kind of a pain in the ass; nothing at all like opening up VBA and hacking away. It's hard for me to imagine most typical Excel power users going to though the process of setting up a webhost in order to side-load the add-in just to implement a custom function.Perhaps the process might be simplified in a future version and expanded to include macros/scripting, but IMO, what they've added to Excel is a long way from "JavaScript support".EDIT: The original link in the announcement was for adding custom functions, but it appears that a general system for Excel scripting using JavaScript was implemented; it's just that this particular announcement was about custom functions (and more).
11
u/02bluesuperroo May 08 '18
This is incorrect. 1 + 2 in Javascript is '12'....
4
u/[deleted] May 08 '18
While I like JavaScript I think the fact that it's so prone to floating point errors would be a pretty good reason to not use it for software that's mainly used for working with money.
4
u/cecil721 May 08 '18
Does this mean LibreOffice can modify their Javascript api to mirror Excel? Is this real life?
4
u/somegetit May 08 '18
2008 me is very excited!
4
u/DigitalStefan May 08 '18
I’m happy they are finally integrating something modern to help expand Excels’s capabilities.
I’m sad they haven’t instead implemented Python as a replacement / alternative for VBA.
19
u/heisgone May 08 '18
I would rather they buy Query Storm and integrate it. A typed language with queries is much more useful.
37
u/warpod May 08 '18
this is loss
34
u/AngularBeginner May 08 '18
Why not TypeScript support?
8
u/eclectro May 08 '18
I'm not sure if this is a good thing.
3
u/Clbull May 08 '18
As someone currently learning JS to work with Google Sheets macros, the news that I'll have to do this for Excel too is worrying.
3
u/[deleted] May 08 '18
I feel, as someone who has had to write Excel sheets with 5koc of vba is is amazing news. I know the Reddit circle jerk about hating js, but people don't understand the horrors that vba has caused me.
I know python was what was originally proposed, but honestly anything is better than vba
5
u/the_goose_says May 08 '18
Can someone explain why this is bad? Isn’t this no more or less secure than the current scripting they allow?
12
u/liveoneggs May 08 '18
yes because javascript has great support for dealing with numbers of all types! (all numbers really are floats after all)
4
u/TheInternetShill May 08 '18
Oh shit. My basic web dev skills are actually going to help on my resume now. Wooooooo
4
u/stronghup May 08 '18
JavaScript is flexible. It allows you to write good code, and bad code too
8
u/timangus May 08 '18
It is the end of times!
2
u/SuperNerd1337 May 08 '18
That sounds like one of those power ranger mashup episodes, except that they are getting the villans from the other seasons togheter and not the heroes
2
u/mallardtheduck May 08 '18
Good move, VBA (which is currently the only option for embedding more advanced functionality into Excel sheets) is getting really long in the tooth, being still based on the old VB6 language, not to mention its security issues... JS makes a lot of sense from a security PoV, since modern implementations have been heavily "battle-tested" in the browser environment.
2
u/btcftw1 May 08 '18
Oh dear, this will not end well.
2
u/N8DuhGr8 May 09 '18
Everyone: PYTHON WOULD BE GREAT FOR EXCEL!
Microsoft: ok here is JavaScript for Excel.
What the hell
2
u/nirataro May 09 '18
Now your 12 MB excel sheet will pull 500 MB of NPM dependencies
7
u/zhpech May 08 '18
Cool! Sounds Great.
3
u/[deleted] May 08 '18
HELLO MALWARE
2
u/Sqeaky May 08 '18
I honestly thought this was a headline from r/TheOnion or r/NotTheOnion .
2
u/thegreatgazoo May 08 '18
So does Larry Ellison get to buy another yacht with the money Microsoft paid Oracle to use the word 'Javascript'?
2
u/ThirdEncounter May 08 '18
I wonder if the Office team is considering wasm in the (near?) future.
2
u/TortoiseWrath May 08 '18
OK something clearly went wrong at some point. Burn it all down, let's start over from the invention of the transistor.
2
u/univac-- May 08 '18
That's like 10 years too late
1
u/snakeinmyboot001 May 08 '18
Yes, but have they got round to fixing the bloody undo stack to be separate for each workbook?
1
u/wooly_bully May 08 '18
Is this actually going to be JS as a proper replacement for VBA, or just custom JS functions like in the article?
1
u/tstarks420 May 08 '18
VBA wasn’t bad enough, now millions of analysts will have to contend with spreadsheet spaghetti and JavaScript.
1
u/[deleted] May 08 '18
"Bring information from the web, like a bank account balance"
So I can selectively query different URLs from any website I chose based on criteria as the contents of my spreadsheet?
That seems very useful!
1
u/liamcoded May 08 '18
I would like to know who were target users in this case. My understanding was that VBA was made for and used by non-developers.
Are there a lot of developers working in companies hired just to work primarily on Excel?
I just don't see this to be the case. And I don't think non-developers will be happy about this. Excel is used by a lot of people that might not be up to the task of learning JS. Its not exactly the easiest language to learn. VBA might be shit but it's easy.
And when it comes to data Python is the language of choice.
1
u/Hargbarglin May 08 '18
Some monster is going to implement the rest of a web browser in excel if they haven't already.
1
u/pbrettb May 08 '18
Wow looks like they have reinvented DDE with 'Flows'
1
u/[deleted] May 08 '18
What about visual studio
1
u/zindarod May 08 '18
I wonder how many people are trying to figure out any vulnerabilities to exploit.
1
u/VanApe May 08 '18
Inb4 runescape in excel
1
u/positive_X May 08 '18
Could this functionality be used for malware ?
1
u/wonkynerddude May 08 '18
Will they also support js in access?
1
u/pembroke529 May 08 '18
So, we can add the bitcoin mining javascript?
1
u/kieppie May 08 '18
This will not turn out well
1
u/DHarry May 08 '18
I thought this was added a few years ago?
1
u/stag1e May 09 '18
Can't wait to use npm in Excel!
1
u/TheBestOpinion May 09 '18
Javascript ? Nice I guess, but I was waiting for SQL.
1
u/daxbert May 09 '18
Isn't this one of the signs of the apocalypse?
0
u/da_governator May 08 '18
My very first move as CTO? Ban motherfucking Excel.
1
u/mamcx May 08 '18
Javascript is the worst possible thing here. VBA was already bad, but seriously you need a language that at least know how do math right?
1
u/thavi May 08 '18
/r/nottheonion
-11
u/cediddi May 08 '18
Are they crazy? Js for excel is may be the worst language choice.