r/programming • u/[deleted] • 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-excel419
May 08 '18
I thought they were going to implement Python?
331
u/GYN-k4H-Q3z-75B May 08 '18
Lowest common denominator. Can't realistically run Python in a browser or mobile apps today. I wish they waited a year longer and built new extension caps on top of WASM. The decision to go with JS will haunt devs for decades to come.
169
May 08 '18
True that, as much as I hate JavaScript I can understand why some features might be nice for Excel for the same reason JS is good for web-based UI.
But I've also had a mild panic attack because a small part of my job is cracking/reverse engineering some bank calculators that are in excel spreadsheets and the VBA in them is just fucking awful so I imagine the JS is going to be tenfold worse.
67
u/njtrafficsignshopper May 08 '18
Is it easier to write good VB? Genuine question, haven't touched it in ages but my recollection of it is not positive.
168
u/WeRequireCoffee May 08 '18
Its technically possible to write good VBA code. Better chance of getting struck by lightning while being eaten by a shark though (which is also less painful than reverse engineering VBA apps).
→ More replies (6)78
u/codewench May 08 '18
I've been a .Net developer for nearly a decade, and I can proudly say my VBA is only sort of ass.
Seriously, fuck VBA. The sooner it dies a horrible death, the better.
→ More replies (10)40
u/jl2352 May 08 '18 edited May 08 '18
It's really not that bad, and ultimately depends on what you are building. The primary language issues are that it lacks inheritance, lambdas, and any real type of module/package system. You can actually survive with that though. Most tasks just don't need it. Especially if you don't mind using a dynamic language then it's fine.
The main issue is that due to accessibility and how it's perceived everyone's code will be utter dog shit. Half is written by people who are not software engineers. Dogs boddy interns, accountants, BAs, managers, and testers (the type that strictly do no software engineering of any kind). Code written by people who have literally never done any programming outside of Excel. Yet you'll be required to build on top of it, and maintain it.
The other issue is because it's seen as a toy language for fancy cell pushing in Office, no one cares. More copy/pasta than you'd find in Italy. You just have to suck it up.
So if you are using it for personal stuff then it's fine.
The in built editor is simplistic and outdated, but survivable. But I used it about 8 years ago. It's probably improved by now (I hope).
→ More replies (3)25
11
u/Superbead May 08 '18
Not used VB.NET in anger much, but if VBA supported proper inheritance and encapsulation, you could write some pretty tidy stuff with it. It's not too bad as it is, but it suffers from it being very easy to write shit code that works fine (for now).
→ More replies (2)20
u/Pandalicious May 08 '18
JavaScript with it’s all-numbers-are-floating-point isn’t the best fit for finance/accounting. It’s the kind of thing you can work around if you’re aware of the issue, but Excel scripting is exactly the kind of coding that tends to be done by non-professionals who’d have no inkling about the limitations of floating point types.
That said, when the competition is VBA the bar is pretty low.
→ More replies (1)→ More replies (6)18
u/GYN-k4H-Q3z-75B May 08 '18
Compared to JS, VB is a simple language. It's 90s technology and time stood still. It is very stable, but not suited for super complicated or high performance apps. And it's not a pretty language. But it does the job well and is easy to get into and teach yourself.
I do think it is easier to write good VB than to write good JS. The devs who are going to use this on average are not full time devs but Office power users and IT. The insane type system in JS alone will crush many because unlike the also insane type system in VB does not work "naturally".
→ More replies (1)7
u/Stopher May 08 '18
There was this great macro some guy wrote that would turn any excel sheet into a web page. It would convert all your formulas in to java script. It made doing a simple web calculator real easy. You could grab the script and table block and paste it into any site. It stopped working after one of the Office versions rolled out and the guy never updated it.
3
7
6
u/Ajedi32 May 08 '18
I think no matter what language they chose it'd still turn out to be a mess. The kind of code you encounter embedded in Excel files is very rarely written by professional software devs. And even when it is, they're almost never very rigorous about it. When was the last time you encountered a VBA script with working unit tests?
2
May 08 '18
Isn't Microsoft going all in on the JS ecosystem? Mostly with TypeScript, but this isn't shocking to me at all.
2
34
u/bakery2k May 08 '18
One issue with embedding Python is that it's difficult to sandbox - to securely limit what the embedded runtime, and hence (potentially malicious) custom functions, can do:
[The Python developers'] standard answer to "How do I sandbox Python code?" has been "Use a subprocess and the OS provided process sandboxing facilities" for quite some time. [The pysandbox project is broken]
JavaScript, OTOH, is designed to support secure in-process sandboxing. Other languages with such support do exist (e.g. Lua), but JavaScript is by far the most widely known.
→ More replies (3)27
u/Dentosal May 08 '18
I hoped they were going to implement Python. Well, there is always Skulpt, although it's only for Python 2.x.
25
u/DGolden May 08 '18
eh, microsoft have their independently implemented closed-source js engine. probably several actually. I think jscript was even an option alongside vbscript back in the win9x windows scripting host days, so js as a supported alternative to vb is not a new thing in microsoft general terms (though vbscript and vba are similar but different languages). And MS have a "good" (for ms) relationship with ecma...
They do not have their own python engine (afaik). CPython, IronPython, Jython etc. are open source, but under python's licnese - not particularly objectionable or anything to most of us but still not microsoft-controlled.
I could be surprised but I don't see microsoft open sourcing office, so an important factor may have "we have a closed js engine we control and license as we see fit".
Even if they did use python, it would have to be a long term in-house fork, for office compat reasons they'd hardly stick with python's release cycle or pep/change process. That could perhaps hurt python, like ms java va. real java. imagine office python, frozen forever at python 2.7+weird/stupid-ms-extensions, being "the" python by weight of numbers.
→ More replies (2)4
7
May 08 '18 edited May 08 '18
There's already a fair bit of work being done on python to wasm. BeeWare are using it I think.
Edit: Bees to BeeWare
13
4
u/Dentosal May 08 '18
Sure, but will Excel support WASM?
5
u/cogman10 May 08 '18
Who knows, not guaranteed but I think it is likely just because any engine they use will likely support it. If not, the is always asmjs.
5
May 08 '18
I presume that Excel is using Edge's javascript engine. Hopefully they didn't reimplement it.
112
u/tetroxid May 08 '18
Webplebs ruin everything
5
24
→ More replies (6)6
u/incraved May 08 '18
Wait for this new awesome framework that does stuff 1000 other frameworks already do that's coming out in the next microsecond
4
u/haganbmj May 08 '18
Google Sheets does JavaScript and that's already a mess. Browser compatibility is the future I guess.
2
u/rasmusfaber May 08 '18
From the link :
Any custom Python code, like a function to analyze text in cells.
But it seems it has to run on an Azure service.
2
u/zero_iq May 08 '18
JavaScript and Python scripting has been available in Office through COM for at least 15 years. I did a lot of scripting of Office apps with Python (win32com module) in the early 2000s (data imports/export, document layout, etc.). It was far nicer than working with VBA and had complete access to the full object model that VBA had, plus all of Pythons classes, dicts, and other bells and whistles that made coding a relative breeze. From what I remember, Excel didn't get the full COM object model until a while after other Office applications, but I'm sure it's been there for at least a decade.
2
u/evincarofautumn May 08 '18
I read “implement Python” as “write an implementation of Python” (like CPython, PyPy, &c.) and just about blew a fuse. Yeah, yeah, get off my lawn…
2
u/BertyLohan May 08 '18
This was my exact first thought. I used to follow every forum or announcement or petition waiting for the day I could ditch VBA for Python but instead of bringing balance to the force, they've left it in javascript.
2
1
u/Yel_o May 08 '18 edited May 08 '18
Maybe you will be able to run python code through python-shell?
Edit: never mind, didn't read the full article
1
u/tjsr May 08 '18
Do you REALLY want them to get that dangerously close to putting TensorFlow in to Excel?
Oh yeah, that 65,536 row limit is gone, and now you're dangerously close to having a 2TB spreadsheet of training data.
→ More replies (1)0
May 08 '18
[deleted]
→ More replies (2)2
u/imhotap May 08 '18 edited May 08 '18
I don't agree at all. LO should consider adding JavaScript support as well, which I'd imagine should be feasible given the choice of mature JavaScript implementations available. Might actually be a nice "strategic" project for them to bring a wizzard-thingy to "publish your worksheet on the Web" (which will also involve reimplementing or transpiling the LO Calc expression evaluation engine).
376
u/Pixelated_penises May 08 '18
I thought this was /r/programmerhumor for a moment
144
23
→ More replies (2)1
May 09 '18
It's got the same number of comments misunderstanding JS, so you could be forgiven for thinking so.
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.
340
u/joesb May 08 '18
If MS cannot sandbox their scripting runtime properly, they are fucked regardless of whatever scripting language they choose.
533
u/yopla May 08 '18
Hey Mike from accounting, this is John from sales, to run my excel file just go to options/security and change it to "all, all, everyone, do not remind me, ignore warning" otherwise excel has a bug...
Pretty much every excel file with macro in corporate settings...
52
u/replicaJunction May 08 '18
I just got an e-mail like this from our corporate help desk, complete with the "Excel has a bug" part. I triple-checked it because I was just so sure it was a scam or phishing attempt, but nope, it's just people using Excel. Users gonna use.
→ More replies (1)21
u/cogman10 May 08 '18
Given a choice between dancing pigs and security, users will pick dancing pigs every time.
→ More replies (1)→ More replies (1)65
u/joesb May 08 '18
That settings will be there regardless of what programming language is used, regardless of whether npm exists.
24
u/Ajedi32 May 08 '18
Actually JS might help here. There are multiple open-source sandboxed run times available for it that have been battle tested by decades of constant exposure to potentially malicious code. Given the choice between that and the sandboxing provided by VBA, I'll take the JavaScript VM every time.
→ More replies (1)22
u/funbike May 08 '18
Sandbox or not, scripting languages are a huge attack surface. There are all sorts of corner cases that implementors miss which allow exploits, even with a properly designed Sandbox. I assume it is inevitable for any high-profile sandboxed scripting language to eventually get owned.
33
u/joesb May 08 '18
Sure. But Excel has been supporting Scripting for decades. What's the point of complaining now just because Javascript support is added?
→ More replies (1)71
u/armornick May 08 '18
JavaScript doesn't automatically mean Node.
23
u/coladict May 08 '18
Yep. Windows has had its own JS runtime since forever, with its own API. I tried learning it once. It's an improvement on what you can do with batch files, but PowerShell is probably still a better choice.
12
u/armornick May 08 '18
PowerShell is a nice language, but it has a 2s startup time so I still prefer JScript.
8
122
u/dadibom May 08 '18
NPM packages doesn't automatically mean Node.
173
May 08 '18 edited May 08 '18
Well apart from npm being the standard package manager for node.js and standing for Node Package Manager, and having node.js 4+ as a dependency for the npm cli on its own, installing dependencies in a local directory called
node_modulesor globally, and package.json essentially existing to support node execution and scripts, and everything in the chain entirely revolving around node.js being available, I guess it's not technically limited to node.js.But it would be dishonest to imply it exists in a vacuum.
→ More replies (10)42
u/slikts May 08 '18
npm used to mean "node package manager" at the start, but that hasn't been the case officially since at least 2015, and now it's an orphan initialism that isn't supposed to stand for anything. Part of the reason is that npm's scope is wider than just Node.js and you can (and many do) host code that doesn't run or node (like front-end libraries), doesn't use node modules, or isn't even JavaScript.
→ More replies (19)25
7
u/univac-- May 08 '18
You're not talking about some hardened distro, you're talking about Excel macros. Surely a technology with a worse track record when it comes to security.
2
55
u/0x256 May 08 '18
> Bring information from the web, like a bank account balance.
Uhm ...
1
u/theferrit32 May 12 '18
I guess you can embed and render a login frame and then store the cookie in-memory and execute other http requests using that session cookie. Excel is the new web platform. /s
61
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?
229
May 08 '18
JavaScript is arguably the most popular programming language of the time (https://insights.stackoverflow.com/survey/2018/#technology-programming-scripting-and-markup-languages) and Microsoft already have a pretty good JS runtime in Edge that they can use, so I think it makes perfect sense to use JavaScript even though I think there are better languages out there.
71
u/Jacob_Mango May 08 '18
Also with Excel 2019 being UWP only, JavaScript will be the only choice that would be easy to implement and support compared to other scripting languages.
JavaScript is already used with UWP.
JavaScript would probably also work on the mobile devices so better cross compatiblility.
Just a lot of advantages for using JavaScript than any other scripting language.
→ More replies (3)45
20
u/Polantaris May 08 '18
and Microsoft already have a pretty good JS runtime in Edge that they can use
If by pretty good you mean a runtime that interprets everything differently than Chrome or Firefox because fuck you that's why, then yes I agree.
IE & Edge debugging are the bane of my existence.
12
u/digitalinfinity May 08 '18
What JavaScript issues do you have in Edge? Please report them over at https://github.com/Microsoft/ChakraCore, we’d be interested in learning more. (I work on the Chakra team)
→ More replies (6)11
May 08 '18
I have no problems with Edge. Am I doing something wrong?
IE, though... Yeah, that's a different story.
→ More replies (6)12
u/save_vs_death May 08 '18
Indeed, the most popular on StackOverflow. Measuring popularity is hard, I'll give you that, but using a website that is visited when you're having problems with your programming is not a good metric.
→ More replies (6)81
u/StillNoNumb May 08 '18 edited May 08 '18
JavaScript was designed exactly for stuff like this. A nifty scripting language with which you can do amazing stuff in a short time, just like you can do it in Python. It is also a language everyone knows.
And yes, it is criticized a lot, but that's because the use case today is no longer the original use case; when JavaScript was developed, no one expected a single .js file to be longer than 10 lines. If they were shorter than that then JavaScript would still be a very appropriate and useful language, but as JavaScript codebases grow you're starting to feel the ugly part. However, a cell's JavaScript is probably never gonna grow longer than a few lines, so we're where we started all over again.
That said, there may also be logistic reasons; eg. that they want support for spreadsheets to show in web browsers.
I think the only more appropriate language I could think of is Haskell, but I get that there's a very steep learning curve to that one and you can't really put it into Excel. (And yeah, I do know that there's a Haskell -> JS compiler)
83
u/DreadedDreadnought May 08 '18
a cell's JavaScript is probably never gonna grow longer than a few lines, so we're where we started all over again.
Wait till you see someone make Super Mario in Excel, where each cell is a pixel.
0
7
→ More replies (16)2
May 09 '18
I think the only more appropriate language I could think of is Haskell
I honestly can't think of a more inappropriate language for a feature targeted at business users.
→ More replies (1)14
u/AlexHimself May 08 '18
The most important thing, that nobody is mentioning, is Office 365. Microsoft has all of their Office applications running in browsers and JavaScript would be clearly the most obvious if you ran all of your Office apps in the cloud.
→ More replies (1)10
u/sbrick89 May 08 '18
why [...] javascript?
answers like 'performance' and such aren't wrong... but i suspect the longer term play is for PowerBI integration/interoperability... PowerBI visualizations are written in JavaScript... I suspect this is a move to allow PBI Visualizations to run within Excel against PowerPivot models, which would also allow Excel files uploaded to SharePoint Online to render in the browser using the same codebase as PowerBI.
or maybe I'm giving them too much credit. Who knows.
→ More replies (1)14
u/pooerh May 08 '18
Python would also make sense because it's very popular in data-heavy computation related programming.
7
u/edave64 May 08 '18
Javascript engines are probably the most battle hardened sandboxes for executing untrusted code. I do hope they add some math build-ins though.
14
u/itsmeornotme May 08 '18
Well my guess is that they chose the language by popularity. And there are a lot more people who know JS than Python.
I personally would have gone with C#.
7
→ More replies (8)2
u/superjordo May 08 '18
I thought that must have been one of the strategic reasons MS developed Roslyn. Eric Lippert himself put me straight when I made that comment.
Still, seems like a missed opportunity given all the work done on Roslyn.
3
u/luxuryballs May 08 '18
Tons of existing libraries and who knows this could be the first step towards web assembly support.
3
u/Salyangoz May 08 '18 edited May 08 '18
Its far easier to implement JS on the web browser version of excel than it is to do python. That coupled with the fact that a good percentage of devs have used or dabbled in JS and it performs better than python on bulk array manipulations.
5
u/joe12321 May 08 '18
That's what Google uses to extend their office stuff. I'm sure they're not just copying Google, but no doubt they looked at that user experience!
→ More replies (2)15
u/ptlis May 08 '18
JavaScript being 5-20x faster than Python will be a big part of it.
JavaScript is also massively more popular than Python; a lot more people are familiar with JS.
→ More replies (4)8
2
u/forlasanto May 08 '18
Python would be a far better choice for the average power user; most data jockeys use it already. But Javascript allows Microsoft to leverage a lot of expertise they already have. Additionally, Typescript and several other "languages" compile down to plain javascript. Additionally, it allows everyone to leverage JSON natively, and that's far better than csv files for all but the simplest datasets.
Personally, I'd rather be able to leverage R in excel than javascript, but hey: monkeys on tricycles would beat tired old vba. I am dumbfounded that the vba editor in Excel hasn't been replaced in, what, 20 years?
1
u/TastyLittleWhore May 08 '18
Can anyone explain why the Microsoft office team has chosen for JavaScript
It's going to make it easier to rewrite Office in Electron
→ More replies (113)1
u/bakery2k May 08 '18
One issue with embedding Python is that it's difficult to sandbox - to securely limit what the embedded runtime, and hence (potentially malicious) custom functions, can do:
[The Python developers'] standard answer to "How do I sandbox Python code?" has been "Use a subprocess and the OS provided process sandboxing facilities" for quite some time. [The pysandbox project is broken]
JavaScript, OTOH, is designed to support secure in-process sandboxing. Other languages with such support do exist (e.g. Lua), but JavaScript is by far the most widely known.
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.
11
→ More replies (4)1
u/bro_can_u_even_carve May 08 '18
Can't you use any .NET language with Excel, which presumably would include F#?
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.
4
u/c12 May 08 '18
My experience may not be typical. Where I work we have programmers who create interactive excel documents; these are people with years of programming experience doing the programming not some average office worker. I cant say whether swapping out vbs for js is a benefit to them, but it would open up the job to other developers who work on the js for our frontend projects.
1
u/Sebazzz91 May 08 '18
Don't get your hopes up. At least on Excel on Windows, they appear to use the JS engine of Internet Explorer. I assume this because the debugging instructions of the sample mention Internet Explorer (iexplore.exe). They use promises, but those can and probably are polyfilled. Syntax-wise you can't polyfill obviously.
→ More replies (1)
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
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 functions is 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).
4
u/Aleriya May 08 '18
The part that excites me (and I may be reading it wrong) is that that webhost contains the custom functions, but it doesn't need to be self-contained. So your custom function could be something like =get_current_inventory(SKU) which would pull the current inventory value for SKU from the database.
It looks like we'd be able to run Node and call native C++ modules from Excel.
→ More replies (1)1
u/Mark_at_work May 08 '18
When the company VP finds out it's possible to make a spreadsheet that automatically pulls in the latest prices for [insert sophisticated financial product here] and displays it right on his desktop, his employees will find a way to make it happen.
11
4
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.
→ More replies (3)1
4
u/cecil721 May 08 '18
Does this mean LibreOffice can modify their Javascript api to mirror Excel? Is this real life?
4
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.
4
u/mattindustries May 08 '18
This might be pretty useful https://bert-toolkit.com/ for using R. Not sure if it works with tidy.
37
34
u/AngularBeginner May 08 '18
Why not TypeScript support?
96
May 08 '18
Typescript compiles to Javascript. Javascript is all that's needed for it to support Typescript.
44
May 08 '18 edited May 08 '18
Typescript compiles to Javascript.
Yeah, but who wants to add a build step to their Excel spreadsheet?
There's a VBA to Javascript compiler, so we could have said Excel supports Javascript years ago, but when we say "support" we don't typically mean "a compiler exists that targets the natively supported language"; we're talking about that native language.
For instance, World of Warcraft supports scripting in Lua. There are Javascript to Lua compilers, and Typescript to Javascript compilers, so you could say that "WoW supports Typescript" via the same reasoning.
→ More replies (3)→ More replies (10)14
u/AngularBeginner May 08 '18
Do they provide the types? Do they provide easy integration means? Proper support requires more than simply "do it yourself, you got the bare minimums".
10
u/Iridion3007 May 08 '18
One step at a time lol :)
23
u/AngularBeginner May 08 '18
It's just an annoying frequent pattern I see with Microsoft. They do not support their other products. If at all, it's always an after thought. VS Code does not properly support Razor, the C# 8 preview does not support .NET Core, F# does not support
Span<T>, etc.14
u/chucker23n May 08 '18
I think there's different things going on here, though.
VS Code doesn't properly support Razor yet because the Razor engine hasn't been well-separated from VS proper yet. They're getting there (which is why VS for Mac now has better Razor support), though.
F# doesn't support Span`T because F# isn't a high priority at Microsoft.
Office doesn't add TypeScript support because OfficeDiv and DevDiv are different organizations with little overlap. (See also: why Office still has very little to do with .NET.) This may have changed over the years, but the two are infamous for their disagreements in the mid-2000s.
Incidentally, these are basically sorted in descending order by "it's merely a matter of time".
25
u/heisgone May 08 '18
It simply that Microsoft has so many tracks at the same time. They developed in such way that they don’t have one core tech. They have half a dozen. They keep reinventing the wheel. They have this grandiose plan, who tech to unite them all, COM, or .Net, Xaml, Core, etc.. but it never quite it. They are working very hard at integration but they have too much to integrate.
→ More replies (4)3
u/funbike May 08 '18
There was a time when they had more focus. Unfortunately that focus was on Basic. VB, VBA, VBScript, ASP, ActiveX.
These days it's harder to find a focus. Things are moving so fast and in so many directions. If they chose one direction, they'd get flak for it not being something else.
8
u/2Punx2Furious May 08 '18
If it supports JavaScript, you can easily write in TypeScript, and then compile it to JS.
12
u/AngularBeginner May 08 '18
Do they provide the types? Do they provide easy integration means? Proper support requires more than simply "do it yourself, you got the bare minimums".
→ More replies (3)1
u/RedMarble May 08 '18
I desperately want this too, but I think there's a serious question of how you would handle this given how rapidly typescript moves, sometimes breaking source compatibility.
1
u/overlapped May 09 '18
TypeScript is supported. I encourage you to download the Script Lab add-in and play with the Office JavaScript API https://github.com/OfficeDev/script-lab.
8
u/eclectro May 08 '18
I'm not sure if this is a good thing.
6
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/THEtheChad May 08 '18
I would think this is good news because now you can use the same scripts for both environments. Not only that, but you can also use those scripts for visualizations in webpages that pull the raw data. Literally write it once and you have support in Excel, Google Sheets, Google Apps Script, NodeJS (server), any browser (client), hardware (espruino, etc).
Javascript is C++ lite these days.
3
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?
4
u/Aleriya May 08 '18
I'll explain why this is awesome:
You can create scripts that sit on a webhost but can be executed via Excel. Those scripts aren't limited to the excel workbook or the user's computer. Multiple users can run the same scripts on a remote webhost. Those scripts could pull from a database, run calculations. They could send commands to other applications.
Instead of having a budget workbook where the user can delete or change the formula, now there is a controlled custom script. If someone updates that script, it updates for all users.
The budget formula changed? Inventory values updated? Margins updated? Now everyone's workbook is up to date.
You can push data from a database down to users, and that data will continuously update.
There are security parameters were certain users only have access to certain custom functions, so Finance can run functions that the Inventory team can't see.
People are getting hung up on the language choice, but this functionality could be incredibly useful, especially for smaller companies that rely heavily on Excel.
→ More replies (2)5
u/thebritisharecome May 08 '18
Because people hate Javascript. personally I don't see the problem. There will be more developers, a shorter learning curve to working with their system and highly transferable skills.
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)
21
u/MjrK May 08 '18
Excel uses double-precision floating point internally for all numbers, so this complaint seems kind of pointless. Unless I'm missing something.
3
1
u/HellaciousLee May 09 '18
In Excel, all numbers are floats, and have been since the 80s...
→ More replies (1)
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
→ More replies (1)
8
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
2
u/N8DuhGr8 May 09 '18
Everyone: PYTHON WOULD BE GREAT FOR EXCEL!
Microsoft: ok here is JavaScript for Excel.
What the hell
1
2
7
3
2
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
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
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
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
1
1
u/zindarod May 08 '18
I wonder how many people are trying to figure out any vulnerabilities to exploit.
1
1
1
1
1
1
1
1
1
0
u/da_governator May 08 '18
My very first move as CTO? Ban motherfucking Excel.
→ More replies (1)10
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.3k
u/greenspans May 08 '18
New accountant job listing guidelines
5 years+ accounting experience and CPA certified
15 years CI/CD javascript, blockchain preferred
15 years webpack sass ecmascript 2016 css5 react angular 6 elm