Search code examples
javascriptnode.jsexcelexcel-udf

Running node.js code in Excel user-defined function


It would be nice if one can run node.js code inside Excel user-defined functions. Something like using js code like VBA. I googled for solutions but cannot find any. Is it possible to do this?


Solution

  • Yes, if you want to use packages from NPM. You could use webpack to combine all the stuff to one js file, it should work.

    webpack as a static module bundler for modern JavaScript applications. When webpack processes your application, it internally builds a dependency graph which maps every module your project needs and generates one or more bundles. you could refers to this document.

    You could also refer to a sample, Yeoman, the Yeoman generator creates a Node.js Office Add-in project. it use webpack combine all files into one js file.