Google 表格 importData、importRange 速度/间隔 - 改进方法? [英] Google sheets importData, importRange speed / interval - ways to improve it?
问题描述
根据谷歌文档(https://support.google.com/docs/answer/58515?hl=en) 当前刷新/重新计算次数如下;
According to google documentation (https://support.google.com/docs/answer/58515?hl=en) current refresh/recalculate times are as follows;
要更改某些 Google 表格功能的更新频率:
To change how often some Google Sheets functions update:
打开电子表格.单击文件 > 电子表格设置.在下面重新计算",从下拉菜单中选择一个设置.点击保存设置.注意:外部数据函数在以下重新计算间隔:
Open a spreadsheet. Click File > Spreadsheet settings. Under "Recalculation," choose a setting from the drop-down menu. Click Save settings. Note: External data functions recalculate at the following intervals:
ImportRange:30 分钟 ImportHtml、ImportFeed、ImportData、ImportXml:1 小时 GoogleFinance:2 分钟
ImportRange: 30 minutes ImportHtml, ImportFeed, ImportData, ImportXml: 1 hour GoogleFinance: 2 minutes
有什么办法可以加快速度吗?例如,删除单元格然后替换它会强制刷新数据.例如,也许这可以通过脚本来完成.甚至可以单独使用脚本从另一个工作表中提取数据吗?
Is there any way in which we can speed this up? For example deleting the cell and then replacing it will force a refresh of the data. Maybe this could be done via a script for example. Can a script even be used on its own to pull in data from another sheet?
有没有人知道如何做到这一点?理想情况下,我希望每 5 分钟刷新一次.
Does anyone have any ideas of how this could be done? Ideally I want a refresh of every 5 minutes.
非常感谢
推荐答案
我实际上找到了一个看起来很有效的解决方案;
I actually found a solution which seems to work quite well;
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("sheet1").getRange('A1').setValue('');
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("sheet1").getRange('A1').setValue('=IMPORTDATA("https://www.dropbox.com/9329382983/file.csv?dl=1")');
- 用 importdata 公式清除单元格,2. 重新添加 importdata 公式.
然后,您可以将此脚本设置为每 x 分钟运行一次.
You can then set this a script to run every x minutes.
这篇关于Google 表格 importData、importRange 速度/间隔 - 改进方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!