Below is my code and on the last line of code I get a “Cannot convert error”. To clarify the line: sheet.getRange throws the error.
That is all the error says; nothing more, just “Cannot convert”. Also, this is the full code, so there is nothing else.
function days(){
var table = new Array(7);
for ( var i = 0; i < 7 ; i ++){
table[i] = i+2;
}
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Want");
sheet.getRange("B2:B9").setValues(table);
}
I don’t know anything about Google Apps Scripting, but I managed to find this on Google.
It appears your table needs to be a 2-dimensional array.
Perhaps this can help?
(code is from the link above)