Slashdot Mirror


Microsoft Adds Support For JavaScript Functions in Excel (bleepingcomputer.com)

An anonymous reader shares a report: At the Build 2018 developer conference that's taking place these days in Seattle, USA, Microsoft announced support for custom JavaScript functions in Excel. What this means is that Excel users will be able to use JavaScript code to create a custom Excel formula that will appear in Excel's default formula database. Users will then be able to insert and call these formulas from within Excel spreadsheets, but have a JavaScript interpreter compute the spreadsheet data instead of Excel's native engine. "Office developers have been wanting to write JavaScript custom functions for many reasons," Microsoft says, "such as: (1) Calculate math operations, like whether a number is prime. (2) Bring information from the web, like a bank account balance. (3) Stream live data, like a stock price."

29 of 171 comments (clear)

  1. What could possibly go wrong? by khandom08 · · Score: 5, Funny

    ....

    1. Re:What could possibly go wrong? by bobstreo · · Score: 5, Insightful

      The worst?

        With the tight security model Microsoft (and intel) always holds, combined with the track record of Javascript, they sky is the limit!

    2. Re:What could possibly go wrong? by Gr8Apes · · Score: 2

      My personal take is there weren't enough holes in Excel, so time to add a new holey framework implemented, of course, by the best MS could outsource.

      --
      The cesspool just got a check and balance.
    3. Re:What could possibly go wrong? by NicknameUnavailable · · Score: 3, Funny

      While Dante's inferno depicts several circles of Hell with the Devil in the center/bottom circle stuck in the floor being tortured for eternity - that's really not even the limit, there's another less well-known circle of Hell smack in the center: the Devil's colon. That is where this will go. That said, it's better than VBA.

    4. Re:What could possibly go wrong? by Oswald+McWeany · · Score: 4, Insightful

      While Dante's inferno depicts several circles of Hell with the Devil in the center/bottom circle stuck in the floor being tortured for eternity - that's really not even the limit, there's another less well-known circle of Hell smack in the center: the Devil's colon. That is where this will go. That said, it's better than VBA.

      It's barely better than VBA. JavaScript is (in the 21st Century) the equivalent of VBA in the 90's. Quick, crude, and unstructured; it's the "rabble" of languages.

      --
      "That's the way to do it" - Punch
    5. Re:What could possibly go wrong? by aberglas · · Score: 2

      VBA is actually an excellent language, better than JavaScript. The main advantage is that it includes static typing which is a killer feature for larger programs. VBA has classes and properties and dynamic typing, only thing missing is closures which are rather esoteric. There are a few historical quirks in both languages.

      End If is actually better than {}s, because the compiler can detect errors -- the {} approach was introduced in Algol 60, replaced with End If (actually Fi) in Algol 68 (1968). Most languages also saw the light and avoided {}s. But then C inflicted {}s back on the world. But that is probably the least bad thing about C. (The worst is counting from 0.)

      But per my previous post, the big thing is that VBA runs in the server, JavaScript is client/server. Impossible for end users to use, which is the point of VBA.,

  2. I'm listening... by MightyYar · · Score: 3, Interesting

    This could be good, if they handle errors well. If they use the same default "fail silently" practice as they do with VBA functions, then it will be just as dangerous as those are.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  3. Yes by cascadingstylesheet · · Score: 4, Funny

    The only thing better than VB in a spreadsheet is JavaScript. This is awesome.

    1. Re:Yes by jellomizer · · Score: 4, Insightful

      Which is at least an Open Standard Programming language. Which works on different OS's and hardware architecture. And designed to run relatively safely on your PC.
      VB is a hold over the Bad Old days of Microsoft. Where to get the feature you needed the entire ecosystem. Even the long time Office for the Mac, didn't didn't support VBscript (or at least not completely)

      The biggest issue I have, is people using Excel and Access as their programming environment, to try to bypass us egotistical developers and get a program running fast. Only to have it break a year down the line and get those egotistical developers digging in poorly written and designed system to make heads or tail on what went wrong.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    2. Re:Yes by Anonymous Coward · · Score: 5, Interesting

      There is a huge group of computer-using professionals that live and breathe Excel.

      They are not programmers. But they do have script-kiddie level of competence, which they use for making Excel formulas and macros.

      These people are in love with Excel, and when they submit requirements for actual software development, they adamantly insist that the software accept Excel documents as input, and that everything the program does be controlled by Excel.

      This creates terrible inefficiency, gobbles up memory, slows the system down, injects an endless stream of bugs and support issues, and lets utterly unqualified people inject code into complex systems with little-to-no insight as to what-all is going to break because of it. But if you try to convince them to allow you to implement some of that logic in a proper coding language, they flatly refuse.

      So, of all the programming languages that are common in the industry, which one is most likely to be one that this class of user has encountered, tampered with, and prefers?

      Of course javascript. One of the Internet's oldest mistakes, and one of the worlds most sloppy and dangerous tools, will be put into the hands of non-programmer power-users to use right in the center of complex mission-critical systems that directly impact things like....oh I dunno....large sums of money moving around.

      The world is run by the wrong people.

    3. Re:Yes by Opportunist · · Score: 4, Funny

      By turning it off.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    4. Re:Yes by Anne+Thwacks · · Score: 2
      There is a huge group of computer-using professionals that live and breathe Excel.

      You have had too much of that white powder - those are not computer professionals - they are either zombies or aliens.

      --
      Sent from my ASR33 using ASCII
    5. Re: Yes by flink · · Score: 3, Insightful

      What does this have to do with a browser? This is Excel. I can write a JS program that will erase your hard drive if I am running it in a shell.

      Feel free to post a link to the source


      var fso = new ActiveXObject( "Scripting.FileSystemObject" );
      fso.deleteFolder( "C:\\", true );

  4. This will be used for mining by xack · · Score: 5, Insightful

    One of the first “apps” for this will be yet another cryptocurrency miner that will be spread around an organization’s spreadsheets.

  5. This is very very welcome...but... by bogaboga · · Score: 3, Informative

    Folks, I will have to say that this development is very welcome though what really saddens me is this: -

    There's no Open Source Excel alternative that comes even close to what Excel can do.

    To make matters worse, there's no [serious] effort to create anything capable.

    1. Re:This is very very welcome...but... by jandrese · · Score: 4, Informative

      Which Excel features are missing from Openoffice Calc that are a showstopper for you?

      --

      I read the internet for the articles.
    2. Re:This is very very welcome...but... by Anonymous Coward · · Score: 2, Insightful

      Running existing Excel macros, Power Pivot, lots of chart types, external data sources, multithreading.

    3. Re:This is very very welcome...but... by guruevi · · Score: 3, Insightful

      I think you shouldn't be using Excel at that point anymore. If your "data scientist" is using Excel, fire him, immediately.

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    4. Re:This is very very welcome...but... by guruevi · · Score: 4, Informative

      You must never have heard of SQL, Python, R, ...

      Try opening an Excel sheet with 15,000 lines and applying a filter... (I just got one of those in my Inbox - 2MB Excel sheet, takes 2 minutes to re-render any changes on an 8-core i7 (Excel: using 16 threads... 4%)

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    5. Re: This is very very welcome...but... by cyber-vandal · · Score: 2

      What should you be using instead?

  6. No, not JavaScript! by null+etc. · · Score: 4, Interesting

    Good God, of all languages, why JavaScript? JavaScript is a terrible programming language! And its floating point math is bonkers, have you ever tried doing 0.1 * 0.2 in JavaScript, the answer is 0.020000000000000004! Can you imagine how main spreadsheet errors this will cause?

    And JavaScript doesn't even have type safety! If Microsoft were smart, they would use a compiled programming language, like C, that you'd have to compile using a command-line compiler with a GPG-Key that you could inspect to avoid government MITM attacks! Now the government can get your tax spreadsheet information!

    And, JavaScript is terrible because a lot of popular JavaScript frameworks have their own package managers! Can you imagine developers BLINDLY TRUSTING whatever package and whatever dependencies it has? Every developer should be forced to only use the OS package manager to install JavaScript libraries!

    And, JavaScript is terrible because hundreds of programmers release hundreds of new packages every day, and they grow old and stale and now the JavaScript package ecosystem is older and staler and more crowded than the iOS app store ecosystem!

    And, JavaScript is terrible because anyone can just pick it up and start playing with it, and they can write a web server in 15 minutes without even knowing about tail recursion or Monte Carlo cyclomatic complexity reduction! Script kiddies will start taking our jobs, and they don't even have to know how to covert an AST optimization into a stack heap implementation!

    I hope that Microsoft realizes the error of their ways, and instead implement something like LISP as the programming language.

    1. Re:No, not JavaScript! by Anne+Thwacks · · Score: 2
      To be fair, javascript is no more unsafe than a cornered rat with rabies.

      FTFY

      --
      Sent from my ASR33 using ASCII
    2. Re:No, not JavaScript! by mark-t · · Score: 2

      Javascript, by itself, is about on par with safety as any other scripting language such as scheme or Lua. Any lack of safety lies entirely in what underlying operating system frameworks are exposed to the api of the script language by the language embedder. By default, there is nothing that stands out to my knowledge in the javascript core library that would be considered unsafe.

      That said, I won't argue that there are a few characteristics of javascript that might make it undesirable as a programming language or even prone to certain types of programmer errors, especially with newcomers, but they do not make the language particularly unsafe to use.

    3. Re:No, not JavaScript! by jaa101 · · Score: 4, Informative

      have you ever tried doing 0.1 * 0.2 in JavaScript, the answer is 0.020000000000000004! Can you imagine how main spreadsheet errors this will cause?

      You appear to be ignorant of the way floating point numbers work. This is not a feature of JavaScript, but of the CPU in your computer. Try entering "=0.1*0.2" in an Excel cell and then turn up the format to 20 digits of precision. I'm not saying that JavaScript is good, but using this as your first example of how bad it is doesn't help your credibility.

  7. Keeping up with the Joneses by ahziem · · Score: 2

    For at least ten years, StarOffice, OpenOffice.org, LibreOffice, and derivatives supported JavaScript and Python in the Calc spreadsheet.

  8. Please shoot me by Opportunist · · Score: 3, Insightful

    But could you please do it before the first batch of Excel-based javascript-empowered cryptominer and other malware arrives in our company?

    Who the FUCK thought it would be a great idea to marry the one file format every idiot opens when it arrives in his mailbox because that's what he does all day with the one scripting language that can the easiest be obfuscated to escape the current antivirus signatures?

    So far I was willing to say that MS simply can't fight malware, but this makes me wonder whether they get a cut of the profits.

    --
    We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
  9. When will they learn? by zarmanto · · Score: 4, Interesting

    Microsoft has added various scripting languages to their Office products over the years... and each and every one has been abused by bad actors at some point, forcing Microsoft to cripple and/or remove the capability. What on earth could possibly make Microsoft think that adding JavaScript to Office documents will be any different? Particularly since it has already been abused in a myriad of ways within web browsers??

    As the old saying goes, "The definition of insanity is doing the same thing over and over again, and expecting different results."

  10. Re:Ummm...so? by Oswald+McWeany · · Score: 2

    I can already manipulate any of Excel's data with C++, C#, VB.NET, VBScript, yes, JavaScript, and any other language that can handle scriptable COM objects. I wouldn't necessarily call this a game changer.

    It's not a game changer to a programmer. It's potentially a game changer to some desk jockey in a low tech job that can copy and paste formulas from the internet and can follow it well enough to make a few simple changes.

    Although... they have VBA for that already.

    --
    "That's the way to do it" - Punch
  11. Not the Excelent Excel Object Model by aberglas · · Score: 3, Interesting

    No, it does not use the Excel Object Model.

    The Excel Object model is actually very good. Sensible and clean (ignoring recent horrors like the ribbon). COM is a mess, but the object model is excellent.

    Moving to JavaScript does not merely men replacing End If with {}. The JavaScript model runs in a client server style, with futures etc. Much, much more complex. That is the essence of the change, Not the actual language.

    10 lines of VBA becomes 100 lines of the new Java API. And is impossible for non-programmers to write. And that is what VBA supports, non programmers.

    In VBA you can even record a macro, see the object handling, and then tidy it up afterwards. Excellent.

    What actual users of Excel want is the VBA to be properly supported. It was abandoned for .Net, which was unusable by non programmers and very difficult to deploy. And now the fashion is Javascript. But since when to developers listen to uses? Wot's hot and wot's not. That is what counts.