I am using the Spreadsheet Services in Google app script to retrieve some data from the Internet and then mess a bit with it. The problem is when I set the ImportHtml value if the data set is larger than say a few rows I do not have access right away to the imported range and thus an error is thrown in the script:
example:
// create tmp sheet and import some data.
var sheet = this.createTmpSheet(); // custom method to create a temp sheet.
sheet.getRange('A1').setValue('=ImportHtml("someUrl","table",1)');
// at this point usually I can access the range
var range_to_copy = sheet.getDataRange();
// However if the data is more than 10-15 rows I get invalid dimention for range..
Any ideas how to wait for the 'readiness' of the import? None of the usuall triggers seemd like an appropriate choice. All I need is to have flow control in such a way as to be notified once the import completes, usually under 10 seconds.