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")
But this IMPORTRANGE call remains static. That is, once imported, the data isn't updated when the imported sheet is changed.
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
does update automatically—just not instantly. Give it 5 minutes.If you really want to do it with code, use
SpreadsheetApp.openById
,getSheetByName
, andgetRange
get
/setValues
.