I am using the below function to get the range values from the Excel online. I am using the Script lab addin developed by Microsoft.
Excel.run(function (ctx) {
var sheetName = "Sheet1";
var rangeAddress = "K6:K500";
var range = ctx.workbook.worksheets.getItem(sheetName).getRange(rangeAddress);
range.load('values');
return ctx.sync().then(function () {
console.log(range);
});
}).catch(function (error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
The problem is that I get an Internal server error exception when I try to get the rows more than 500.
Please note that this behavior is not seen on normal Excel files that contains numbers and text. My sheet contains (especially in Column K which I am trying to fetch from the program) more than 250 characters in each cell. When I use this template, I get this internal server error. Also this issue is seen only in Excel Online and it works perfectly in Excel Desktop Client.