Reputation: 31
I have a sheet that pulls alot of finance data from alot of web pages using HTML. Problem is that it slows down alot. Plus it starts giving errors due to high number of HTMLs and etc.. i looked for the following solutions:
IS there a way to ristrict the sheet from auto refreshing so many times...?
Upvotes: 1
Views: 1499
Reputation: 2998
In the documentation you can see that:
Functions that pull data from outside the spreadsheet recalculate at the following times:
- ImportRange: 30 minutes
- ImportHtml, ImportFeed, ImportData, ImportXml: 1 hour
- GoogleFinance: may be delayed up to 20 minutes
If you want to recalculate the value for your importHTML
functions with a lower frequency you should definitely use Apps Script to do the data fetch and then populate your Spreadsheet with the information.
You can use UrlFetchApp class on Apps Script to get the data and define your timing logic for the updates.
function myAppScriptFunction() {
var urls = ["your-website-url1", "...", "your-website-urlN"];
var response = UrlFetchApp.fetchAll(urls);
//... Parse the response and store the information you need in a table-like data structure
// Let's assume the variable parsedResponseData is created
var ss = SpreadsheetApp.getActiveSheet();
ss.getRange("your-range").setValues(parsedResponseData);
}
You should now wrap your function in your custom time logic to manage the updates. You can achieve this with a time-driven trigger on Apps Script.
function triggerSetup() {
ScriptApp.newTrigger('myAppScriptFunction')
.timeBased()
.everyHours(6)
.create();
}
Upvotes: 1
Reputation: 1
you may try this addon which freezes your spreadsheet on demand:
https://gsuite.google.com/marketplace/app/spreadsheet_freezer/526561533622
Upvotes: 0