简体   繁体   English

Importrange自动运行?

[英]Importrange to run automatically?

Using Google scripts, I'm creating a bunch of spreadsheets each of which contains an importrange function. 使用Google脚本,我创建了一堆电子表格,每个电子表格包含一个importrange函数。 In new google sheets one needs to allow access for that importrange to fetch data from a source file - I was wondering whether it was possible to make it automatic using Google scripts and get round the need to press "allow" manually each time? 在新的Google表格中,需要允许该importrange从源文件中获取数据的访问权限-我想知道是否有可能使用Google脚本使其自动运行,并且是否每次都需要手动按“允许”?

It is definitely possible to write an importrange function in Apps Script, but you'll need to run it too, so I don't know if it's going to be any better than clicking "allow". 绝对可以在Apps脚本中编写importrange函数,但是您也需要运行它,因此我不知道它是否会比单击“允许”更好。

I guess that, depending on your use-case, you could write a single script in the source sheet that pushes the data to the other sheets and possibly even create them automatically for you. 我猜想,根据您的用例,您可以在源工作表中编写一个脚本,将数据推送到其他工作表,甚至可能为您自动创建它们。 Therefore saving you this click per sheet and possibly some other clicks. 因此,可以为您节省每张纸的点击次数,并可能为您节省其他点击次数。 We can surely help you here in StackOverflow, but it's mostly working out problems, you'll have to put in some effort to develop it yourself. 我们当然可以在StackOverflow中为您提供帮助,但是它主要是解决问题,您必须付出一些努力才能自行开发它。 Take a look at Apps Script page to get started. 查看Apps脚本页面以开始使用。

I was facing the same issue and I don't think access can be granted through script. 我遇到了同样的问题,我认为无法通过脚本授予访问权限。 It needs to be done manually in each spreadsheet. 需要在每个电子表格中手动完成。

Best part is it needs to be done only once in any spreadsheet then it will update automatically. 最好的部分是,在任何电子表格中只需完成一次,然后它将自动更新。

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

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