本文介绍了功能IMPORTRANGE未更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望每次打开一个电子表格时都使用IMPORTRANGE函数,以便此打开的电子表格可以与另一个电子表格同步.因此,在A1中,我放置了一个调用公式,如下所示:

I want to use the IMPORTRANGE function every time I open one spreadsheet so this opened spreadsheet can be synchronized with another spreadsheet. So, in A1, I put a call formula like this:

=importrange("0AmEr9uNtZwnNdDFKMTVlbmZYZ3ZyOWM0aXpZS2twM1x";  "myData!A1:W384")

但是此IMPORTRANGE调用保持静态.也就是说,一旦导入,更改导入工作表时数据就不会更新.

But this IMPORTRANGE call remains static. That is, once imported, the data isn't updated when the imported sheet is changed.

那怎么了?我想知道是否可以在Google Apps脚本(类似于JS代码)中使用电子表格功能IMPORTRANGE.

So what is wrong? I wonder if I can use IMPORTRANGE, a spreadsheet function, within a Google Apps Script (which is like JS code).

如何在脚本中调用电子表格功能?

How can I call a spreadsheet function inside a script?

推荐答案

ImportRange确实会自动更新—并非立即更新.给它5分钟.

ImportRange does update automatically—just not instantly. Give it 5 minutes.

  1. 在您打开电子表格并且
  2. 之前,它不会更新
  3. 打开的那个必须具有对源的读取"权限.
  1. It won't update until you open the spreadsheet and
  2. The one opening it must have "read" permission to the source.

如果您真的想使用代码来实现,请使用SpreadsheetApp.openByIdgetSheetByNamegetRange get/setValues.

If you really want to do it with code, use SpreadsheetApp.openById, getSheetByName, and getRange get/setValues.

这篇关于功能IMPORTRANGE未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 19:12