Excel supports custom functions using JavaScript


Microsoft recently announced support for creating custom functions directly in Excel using JavaScript, currently in developer preview. This feature goes beyond the scope of the existing Microsoft Office JavaScript APIs, a set of APIs limited to building plug-ins or web applications that interact with the object model in Office applications.

The Microsoft Office team has created a GitHub code repository that demonstrates how to create custom functions in Excel using JavaScript. The sample code base divides the functions into four categories.

  • JavaScript: Custom Function Source Code
  • JSON: Excel is used to display the metadata of available custom functions
  • HTML: Preview publishing mechanism for referencing relevant JavaScript source code and methods for initializing custom functions
  • XML: tells Excel about the location and namespace of custom functions and their resources

Custom functions have no associated user interface, and developers should not try to manipulate the DOM. The development team would like to remove the HTML files used for custom function initialization before the final release of this feature.

Support for modern JavaScript features such as Promise allows developers to define custom functions as synchronous functions for quick evaluation, or as asynchronous functions for calculations that may take a while to complete. Streams are an asynchronous Promise that can return values multiple times, not just once, which is an option for Excel custom JavaScript functions.

Excel's JavaScript also makes use of the Chakra JavaScript engine used by Microsoft's Edge browser.

Custom functions are currently only supported on Windows, Mac, and Excel Online for the Developer Preview version of Excel, and do not apply to Excel on mobile devices or production versions of Excel.

This feature brings some functionality similar to Google Sheet, which already supports custom functions using JavaScript.

TypeScript users can also write custom JavaScript functions, except that they have to convert to JavaScript first. Microsoft does not intend to provide direct TypeScript support in Excel.

Although there is no official product release date for customizing JavaScript functions in Excel, users interested in this feature should try this preview release and provide feedback to the Office team.

View original in EnglishMicrosoft Announces JavaScript Support for Excel Custom Functions


Recommended>>
1、How to Configure a Redis Cluster on CentOS 7
2、DockerSwarm is dead Kubernetes lives forever
3、Some basics of nerdy io stream input and output
4、About Ubuntu 1804 Google Chrome frequently stuck solution
5、JS image preloading plugin

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号