当前位置: 动力学知识库 > 问答 > 编程问答 >

How do I call a function inside Google Sheets using google apps script

问题描述:

I don't know if this is an intermittent problem, I am doing something blindingly obviously wrong, or google apps script has changed and it doesn't work anymore.

Literally all I have is the following and it's not having a bar of it

function main(){

Logger.log("Hello");

}

function createMenu() {

var ss = SpreadsheetApp.getActiveSpreadsheet();

var menuEntries = [];

menuEntries.push({name: "Test Item", functionName: "main"});

ss.addMenu("Test Menu", menuEntries);

}

But all I get when I click the menu option is

What's going on, am I missing something :(

Thanks heaps

网友答案:

Thanks for all the prompt replies!

Checked it this morning (~5 mins ago) and it's working. I changed nothing and it now works. Very strange.

Must have been an intermittent problem, albeit for a very long period of time. Weird that I haven't seen this problem on a forum somewhere. Still have no idea what caused it but hey it's working now haha.

Bottom line: intermittent problem :(

分享给朋友:
您可能感兴趣的文章:
随机阅读: