I have this script running from one source file to several other files where I use the data. The script has always tended to work fine but recently started getting the error
Exception: Service Spreadsheets timed out while accessing document with id.
I only get the error when the script is running for a particular destination file, as opposed to others. It also happens that this destination file is much larger than the others (maybe the problem). Anyway, the script is below and wondering if anyone has any alternative suggestions or feedback.
function Function_name() {
var ss=SpreadsheetApp.getActiveSpreadsheet()
var sourcesheet=ss.getSheetByName("RAWFINEX")
var data=sourcesheet.getDataRange().getValues()
var destinationfile=SpreadsheetApp.openById("Sheet ID")
var destinationsheet=destinationfile.getSheetByName("RAWFINEX")
var destinationlr=lastUsableRow(destinationsheet)
var destinationlc=destinationsheet.getLastColumn
var existingdata=destinationsheet.getRange(1,1,destinationlr,5).clearContent
var destinationrange=destinationsheet.getRange(1,1,data.length,data[0].length)
var pastedata=destinationrange.setValues(data)
}