0
votes

In this Custom Function Office Add-In project, I need a base64 function.

I am testing the add-in in an installed Office 365 Excel (Version 1908).

I tried to use btoa but it is not available for the add-in.

So I tried to use the base-64 library and the Crypto-js, putting a <script> tag at the functions.html, before the closing body tag, but I could not reference the functions. I used these CDNs, respectively, to import each of the libraries: https://cdnjs.cloudflare.com/ajax/libs/Base64/1.1.0/base64.js and https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/enc-base64.js.

I also did a npm install crypto-js base-64 --save and tried to use the import { xxx } from "library"; statement at my functions.ts, with no success either: the add-in does not even load.

The project was generated with the https://yeoman.io/.

How can I reference an external library in my Office add-in?

1

1 Answers

0
votes

So, a teammate figured it out: we were doing from { } import "xxx" right after the function decorator. Changed to the beginning and it worked.