Is there a size limit regarding the 'address' in the copyFrom function?

Eric MALOISEL 0 Reputation points

Good morning,

I have an excel script that filters a table and copies the visible part of the table to another sheet. The starting table is a list of error messages collected from a system on a daily basis and therefore varies in number of rows every day.

Some days, the script fails on the copy function with the indication that the variable which contains the list of cell addresses to copy is not in the correct format.

The code is as follows:

 // Setting a filter      
TableImportJson.getColumnByName("Error_message").getFilter().applyCustomFilter("=*CfgData*", "=*CfgPrice*", ExcelScript.FilterOperator.or);

// Copy the visible lines in the table to another sheet
const visibleTableRange: ExcelScript.RangeView = TableImportJson.getRange().getVisibleView();
const source = ImportJSON.getRanges(visibleTableRange.getCellAddresses().toString());    DataErrorsSheet.getRange("A1").copyFrom(source, ExcelScript.RangeCopyType.all);

Attached is the content of 'source' from a run of the script which failed.

Thank you for your help.

A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,300 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
827 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,294 questions
0 comments No comments
{count} votes