I've written gs script to clear data from all cells in sheets. Spreadsheet has a lot of sheets (about 200) and I get error of time limit execution. Maybe somebody have ideas how to resolve this issue. Here example of my code.
function cleanAllOld() {
var sheetsName = new Array();
var destination = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/link");
var sheets = destination.getSheets();
for (var k = 0; k < sheets.length; k++) {
sheetsName.push([sheets[k].getName()]);
for (var p = 0; p < sheetsName.length; p++) {
var sheet = destination.getSheetByName(sheetsName[p]);
if (sheet === null) {} else {
sheet.getDataRange().clearContent();
}
}
}
}