繁体   English   中英

Google表格加载项中的自定义功能

[英]Custom Function in Google Sheets Add-On

我正在尝试为Google表格创建自定义功能作为附加组件。

一切在我的电子表格中都可以正常运行,我还可以通过Google Chrome提供给我的链接通过Web chrome存储下载它。

我唯一的问题是无法通过Google表格附加商店使自定义功能生效。

不知道我是否必须在manifest.json文件中放入更多信息,或执行其他操作。

我的应用程序已注册,没有与外部服务的连接,并且仅使用常规的javascript函数拆分字符串对象。

这是代码结构:

function onOpen(e) {
  SpreadsheetApp.getUi().createAddonMenu()
      .addItem('Start', 'use')
      .addToUi();
}

/**
* Enables the add-on on for the current spreadsheet (simply by running) and
* shows a popup informing the user of the new functions that are available.
*/
function use() {
var title = "Example";
var message = "The Function GETID is now available in this spreadsheet";
var ui = SpreadsheetApp.getUi();
ui.alert(title, message, ui.ButtonSet.OK);
}

function onInstall(e) {
    onOpen(e);
}

/**
* example
* @param {string} input the example URL.
* @return The example URL.
* @customfunction
*/
function GETID(URL) {
    return 'example '+URL;
}

发布Google加载项与发布Chrome Web Store扩展程序的过程不同。 加载项也仅在开发人员预览中。 这并不会阻止您发布加载项,但这意味着它必须首先获得Google的批准。 页面包含用于提交您的加载项以供批准的表格,以及有关发布过程的其他信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM