Created
July 12, 2023 04:38
-
-
Save theangkko/fc3fc5e15e586796814bc659a56e693b to your computer and use it in GitHub Desktop.
OfficeJS-excel custom function
by theangkko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tgCF | |
description: |- | |
OfficeJS-excel custom function | |
by theangkko | |
host: EXCEL | |
api_set: {} | |
script: | |
content: > | |
// $("#run").click(() => tryCatch(run)); // async function run() { // | |
await Excel.run(async (context) => { // const sheet = | |
context.workbook.worksheets.getActiveWorksheet(); // console.log("Your | |
code goes here"); // await context.sync(); // }); // } // /** Default | |
helper for invoking an action and handling errors. */ // async function | |
tryCatch(callback) { // try { // await callback(); // } catch | |
(error) { // // Note: In a production add-in, you'd want to notify the | |
user through your add-in's UI. // console.error(error); // } // } | |
/** | |
* check version | |
* @customfunction | |
* @returns {string} check version of add-in. | |
*/ | |
function version_myGistFunction() { | |
// return "publish on 2023-05-31, myGistFunction"; | |
return "publish on 2023-05-31, myGistFunction"; | |
} | |
/** @CustomFunction */ | |
function add10(x: number): number { | |
return x + 10; | |
} | |
/** @CustomFunction */ function sumGist(x: number, y: number): number { | |
return x + y; | |
} | |
language: typescript | |
libraries: | | |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js | |
@types/office-js | |
[email protected]/dist/css/fabric.min.css | |
[email protected]/dist/css/fabric.components.min.css | |
[email protected]/client/core.min.js | |
@types/core-js | |
[email protected] | |
@types/[email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment